icn icn - 1 year ago 110
Ruby Question

ruby watir to get html of a page

I have looked through the examples on these pages


I still don't see a simple example of getting html of a page.

browser = Watir::Browser.new
browser.goto 'mysite.com'

I have tried

puts browser.text

It seems not working.


Answer Source

This should do it:

puts browser.html