【问题标题】:chromedriver not found error on heroku app在heroku应用程序上找不到chromedriver错误
【发布时间】:2018-12-01 15:23:45
【问题描述】:

我想在我的 heroku 应用上使用 selenium。所以我添加了以下构建包。

以下是使用 selenium、chrome 和 chromedriver 的 python 代码

from selenium import webdriver

# from selenium.webdriver.chrome.options import Options

import os

import pickle

from selenium.webdriver.support.ui import WebDriverWait

from selenium.webdriver.chrome.options import Options as ChromeOptions

chrome_bin = os.environ.get('GOOGLE_CHROME_SHIM', None)
opts = ChromeOptions()
opts.binary_location = chrome_bin
driver = webdriver.Chrome(executable_path="chromedriver", 
chrome_options=opts)

我收到以下错误 FileNotFoundError: [Errno 2] 没有这样的文件或目录:'chromedriver': 'chromedriver'

请帮帮我。

【问题讨论】:

    标签: python google-chrome selenium heroku selenium-chromedriver


    【解决方案1】:

    我正在回答任何有同样问题的人。所以问题是当我添加构建包时,它要求我运行“git push heroku master”以在应用程序中使用构建包,但这不起作用。您需要更改代码,并且您应该在 git 上推送代码,以便它的应用程序再次运行并重建自身。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-26
      • 2018-07-07
      • 2022-07-28
      • 2018-10-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多