【发布时间】:2018-04-06 04:52:23
【问题描述】:
我正在尝试在 heroku 上使用烧瓶部署 selenium 脚本。
我添加了以下构建包
- https://github.com/heroku/heroku-buildpack-xvfb-google-chrome
- https://github.com/heroku/heroku-buildpack-chromedriver
我还创建了配置变量:
-
CHROMEDRIVER_PATH = "/my-app/.chromedriver/bin/chromedriver" -
GOOGLE_CHROME_SHIM = "/my-app/.apt/usr/bin/google-chrome"
下面是引用chromedriver的Python sn-p:
chrome_bin = os.environ.get('GOOGLE_CHROME_SHIM', None)
opts = ChromeOptions()
opts.binary_location = chrome_bin
browser = webdriver.Chrome(executable_path="chromedriver", chrome_options=opts)
但是当我打开我的应用程序时发生以下错误:
WebDriverException:消息:未知错误:/tmp/build_4cef63dfa1c952837ceb30f2e894524a/.apt/usr/bin/google-chrome-stable` 处没有 chrome 二进制文件
请帮忙!!!!
【问题讨论】:
-
你不应该在 heroku 上使用 selenium,它不适合它。获取 browserstack、saucelabs 等在线服务,然后使用远程 webdriver
标签: python google-chrome selenium heroku selenium-chromedriver