Method: Ferrum::Frame::DOM#body

Defined in:
lib/ferrum/frame/dom.rb

#bodyString

Returns current page’s html.

Examples:

browser.go_to("https://google.com/")
browser.body # => '<html itemscope="" itemtype="http://schema.org/WebPage" lang="ru"><head>...

Returns:

  • (String)

    The HTML source of the current page.



94
95
96
# File 'lib/ferrum/frame/dom.rb', line 94

def body
  evaluate("document.documentElement?.outerHTML") || ""
end