class WatirForCrawler::Browser

Attributes

browser[R]

Public Class Methods

new(url) click to toggle source
# File lib/watir_for_crawler.rb, line 7
def initialize(url)
  @browser = begin
    temp = Watir::Browser.new :chrome, options: { args: WatirForCrawler::BROWSER_CONFIG }
    temp.goto url
    temp
  end
end

Public Instance Methods

close_browser() click to toggle source
# File lib/watir_for_crawler.rb, line 17
def close_browser
  Rails.logger.info "close browser" 
  browser.close
end
to_html() click to toggle source
# File lib/watir_for_crawler.rb, line 22
def to_html
  browser.html
end