首页 > 解决方案 > 如何在heroku中添加Mozilla firefox

问题描述

>heroku 日志 -n 10

2021-02-06T18:25:04.446002+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
2021-02-06T18:25:04.446187+00:00 app[worker.1]: response = self.execute(Command.NEW_SESSION, parameters)
2021-02-06T18:25:04.446189+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
2021-02-06T18:25:04.446382+00:00 app[worker.1]: self.error_handler.check_response(response)
2021-02-06T18:25:04.446384+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
2021-02-06T18:25:04.446562+00:00 app[worker.1]: raise exception_class(message, screen, stacktrace)
2021-02-06T18:25:04.446600+00:00 app[worker.1]: selenium.common.exceptions.SessionNotCreatedException: Message: Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line
2021-02-06T18:25:04.446605+00:00 app[worker.1]:
2021-02-06T18:25:04.551198+00:00 heroku[worker.1]: Process exited with status 1
2021-02-06T18:25:04.629606+00:00 heroku[worker.1]: State changed from up to crashed

我正在尝试在heroku中使用instapy并在这里遇到了这个问题,看起来buildpack和路径变量有问题我已经安装了以下buildpacks来运行firefox http://github.com/buitron/geckodriver-buildpack http:/ /github.com/buitron/firefox-buildpack

这是我的配置变量

火 /usr/bin/firefox/

FIREFOX_BIN /app/vendor/firefox/firefox

GECKODRIVER_PATH /app/vendor/geckodriver/geckodriver

LD_LIBRARY_PATH /usr/local/lib:/usr/lib:/lib:/app/vendor

路径 /usr/local/bin:/usr/bin:/bin:/app/vendor/

标签: herokufirefoxgeckodriverselenium-firefoxdriverinstapy

解决方案


推荐阅读