lib/scrap_kit/recipe.rb in scrap_kit-0.1.13 vs lib/scrap_kit/recipe.rb in scrap_kit-0.1.14
- old
+ new
@@ -2,11 +2,11 @@
require "webdrivers/chromedriver"
require "watir"
module ScrapKit
class Recipe
- attr_accessor :user_agent
+ attr_accessor :user_agent, :browser
class << self
def load(source)
input = if source.is_a?(Hash)
source
@@ -212,9 +212,12 @@
if chrome_bin = ENV["GOOGLE_CHROME_SHIM"]
options.add_argument "--no-sandbox"
options.binary = chrome_bin
end
- Watir::Browser.new(:chrome, options: options)
+ new_browser = Watir::Browser.new(:chrome, options: options)
+ new_browser.driver.manage.timeouts.page_load = 120
+
+ new_browser
end
end
end