Answers for "kimurae heroku config"

0

kimurae heroku config

heroku buildpacks:add heroku/ruby
heroku buildpacks:add https://github.com/heroku/heroku-buildpack-google-chrome
heroku buildpacks:add https://github.com/heroku/heroku-buildpack-chromedriver
heroku buildpacks:add --index 1 heroku-community/apt

heroku config:set SELENIUM_CHROME_PATH=/app/.apt/usr/bin/google-chrome
heroku config:set CHROMEDRIVER_PATH=/app/.chromedriver/bin/chromedriver
Posted by: Guest on August-24-2021
0

kimurae heroku config

require 'bundler'
Bundler.require

Kimurai.configure do |config|
  config.selenium_chrome_path = ENV['SELENIUM_CHROME_PATH'].presence
  config.chromedriver_path = ENV['CHROMEDRIVER_PATH'].presence
end

class Spider < Kimurai::Base
  @engine = :selenium_chrome
  @start_urls = ['http://example.com']

  def parse(response, url:, data: {})
    p response.at('h1').text
  end
end

Spider.crawl!
Posted by: Guest on August-24-2021

Browse Popular Code Answers by Language