Switch to headless Chrome for capybara/selenium scraping

pull/656/merge
Thibaut Courouble 8 years ago
parent 2ff56e28a1
commit 65e8236ab5

@ -49,10 +49,13 @@ module Docs
def load_capybara_selenium
require 'capybara/dsl'
Capybara.register_driver :selenium_marionette do |app|
Capybara::Selenium::Driver.new(app, marionette: true)
require 'selenium/webdriver'
Capybara.register_driver :chrome do |app|
options = Selenium::WebDriver::Chrome::Options.new(args: %w[headless disable-gpu])
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
end
Capybara.current_driver = :selenium_marionette
Capybara.javascript_driver = :chrome
Capybara.current_driver = :chrome
Capybara.run_server = false
Capybara
end

Loading…
Cancel
Save