diff --git a/lib/scrapers/base_scraper.rb b/lib/scrapers/base_scraper.rb index bb2cca6..21ed4e3 100644 --- a/lib/scrapers/base_scraper.rb +++ b/lib/scrapers/base_scraper.rb @@ -8,7 +8,12 @@ def initialize @browser = init_browser @page = nil - path = ENV['GOOGLE_CHROME_BIN'] || ENV['GOOGLE_CHROME_SHIM'] + path = ENV['GOOGLE_CHROME_SHIM'] || ENV['GOOGLE_CHROME_BIN'] + if Rails.env.development? + Selenium::WebDriver::Chrome::Service.driver_path = path || '/usr/bin/chromium-browser' + else + Selenium::WebDriver::Chrome::Service.driver_path = path + end end private diff --git a/lib/scrapers/json_scraper.rb b/lib/scrapers/json_scraper.rb index cce14b2..eb8f079 100644 --- a/lib/scrapers/json_scraper.rb +++ b/lib/scrapers/json_scraper.rb @@ -25,9 +25,9 @@ def self.get_base_url def self.init_browser path = ENV['GOOGLE_CHROME_SHIM'] || ENV['GOOGLE_CHROME_BIN'] if Rails.env.development? - Selenium::WebDriver::Chrome.path = path || '/usr/bin/chromium-browser' + Selenium::WebDriver::Chrome::Service.driver_path = path || '/usr/bin/chromium-browser' else - Selenium::WebDriver::Chrome.path = path + Selenium::WebDriver::Chrome::Service.driver_path = path end options = Selenium::WebDriver::Chrome::Options.new chrome_dir = Rails.root.join('tmp', 'chrome') diff --git a/lib/tasks/match_scraper.rake b/lib/tasks/match_scraper.rake index 4db2626..40b96ff 100644 --- a/lib/tasks/match_scraper.rake +++ b/lib/tasks/match_scraper.rake @@ -18,9 +18,9 @@ end def init_browser path = ENV['GOOGLE_CHROME_SHIM'] || ENV['GOOGLE_CHROME_BIN'] if Rails.env.development? - Selenium::WebDriver::Chrome.path = path || '/usr/bin/chromium-browser' + Selenium::WebDriver::Chrome::Service.driver_path = path || '/usr/bin/chromium-browser' else - Selenium::WebDriver::Chrome.path = path + Selenium::WebDriver::Chrome::Service.driver_path = path end options = Selenium::WebDriver::Chrome::Options.new chrome_dir = Rails.root.join('tmp', 'chrome')