Skip to content

Getting the Real HTML Source #2

Closed
jherzog opened this Issue May 22, 2012 · 2 comments

2 participants

@jherzog
jherzog commented May 22, 2012

Watir's browser.html does not return the actual HTML code, but some pseudo-html generated from the DOM. Being able to get the actual page source is very important and useful for doing things like testing for XSS vulnerabilities. Currently I am using a combination of Win32 API hacks and RAutomation to get the real source code out of IE by opening the view source window, selecting all, copy, then getting the contents of the clipboard. This will obviously only work for IE, and has to be rewritten for every browser.

It would be VERY nice if watir included some standardized functionality for getting the real HTML source from any browser.

Some links I came across while searching for this:

http://www.velocityreviews.com/forums/t832225-downloading-web-pages-in-watir.html
http://www.ruby-forum.com/topic/187229
http://comments.gmane.org/gmane.comp.web.watir.general/2407

@jarmo
Watir member
jarmo commented Oct 20, 2012

Watir returns document outerHTML:
http://msdn.microsoft.com/en-us/library/ie/ms534310(v=vs.85).aspx

What do you mean by the "real" html?

@jarmo
Watir member
jarmo commented Jan 22, 2013

Closing this because there's no activity.

@jarmo jarmo closed this Jan 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.