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:
Watir returns document outerHTML:
What do you mean by the "real" html?
Closing this because there's no activity.