【问题标题】:Unable to find Mozilla geckodriver error when running Heroku Rake Task运行 Heroku Rake 任务时找不到 Mozilla geckodriver 错误
【发布时间】:2018-06-08 17:02:44
【问题描述】:

我尝试在 Heroku 上运行以下 rake 任务:

require 'nokogiri'
require 'watir'

desc "where the good stuff happens"
task :get_interesting_data => :environment do

    browser = Watir::Browser.new :firefox, headless: true
    ...some web scraping and other tasks...
end

我收到了错误

Selenium::WebDriver::Error::WebDriverError: Unable to find Mozilla geckodriver. Please download the server from https://github.com/mozilla/geckodriver/releases and place it somewhere on your PATH. More info at https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver.

...当我运行 rake 任务时。看起来以前在https://github.com/ivandeex/heroku-buildpack-firefox.git 有一个不再可用的构建包。关于如何进行此运行的任何想法?

【问题讨论】:

  • 您自己找到解决方案了吗?我安装了 buildpacks,但仍然是同样的错误
  • 没有。从来没有找到解决办法。
  • 我已经开始赏金了,让我们看看是否有人认真研究一下。

标签: heroku watir


【解决方案1】:

使用这些heroku buildpacks: http://github.com/buitron/firefox-buildpackhttp://github.com/buitron/geckodriver-buildpack

另外,根据他们的 wiki 设置路径,并确保在代码中添加 Selenium::WebDriver::Firefox::Binary.path=ENV['FIREFOX_BIN']

【讨论】:

    猜你喜欢
    • 2017-04-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-24
    • 1970-01-01
    • 2016-11-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多