【问题标题】:Webdrivers not working with Selenium (Python)Webdrivers 不使用 Selenium (Python)
【发布时间】:2020-08-29 19:55:43
【问题描述】:

我已经尝试了各种解决方案来解决这个问题。 系统配置:

  • MacOS Catalina
  • Python 3.7.6 (Anaconda)
  • 硒 3.141
  • Chrome v81、ChromeDriver v81。

    错误:无法连接到服务 chromedriver。

我已经尝试过使用各种驱动程序和浏览器:Gecko/Firefox(全新安装)、Safaridriver/Safar - 都出现相同的错误。

chromedriver、geckodriver 在 PATH 以及 usr/local/bin 中。

要重现的代码:

from selenium import webdriver
chromedriver = '/usr/local/bin/chromedriver'
driver = webdriver.Chrome(chromedriver)

我也尝试了各种解决方案,executable_path=chromedriverhosts file with localhost 127.0.0.1 entry

chromedriver 本身运行完美,没有任何问题,它似乎无法连接到 Selenium。

如有可能,我们将不胜感激。

预期结果:Selenium connects to driver

实际结果:raise WebDriverException("Can not connect to the Service %s" % self.path) selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service /usr/local/bin/chromedriver

已经尝试过的解决方案:

以及其他关于 SO 的解决方案。

【问题讨论】:

标签: python selenium selenium-webdriver selenium-chromedriver


【解决方案1】:

在尝试完成这项工作时,我在创建 venv 和 docker 映像时不知何故搞砸了。整个 Python 以及 chrome 驱动程序都被破坏了。不得不重装系统。

这以某种方式解决了我的硒问题。如果其他人找到此错误的答案,请务必放弃您的解决方案。

在此之前,这是我关于如何使用它的最新信息。

【讨论】:

    猜你喜欢
    • 2021-01-25
    • 2022-01-27
    • 2015-04-10
    • 2018-04-09
    • 1970-01-01
    • 1970-01-01
    • 2012-01-24
    • 2022-06-29
    • 1970-01-01
    相关资源
    最近更新 更多