【问题标题】:selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:36059 Ubuntu 20 LTSselenium.common.exceptions.WebDriverException:消息:未知错误:无法在 127.0.0.1:36059 Ubuntu 20 LTS 连接到 chrome
【发布时间】:2022-10-20 12:25:08
【问题描述】:

所以,我的代码如下

import undetected_chromedriver.v2 as uc2
options = uc2.ChromeOptions()

browser=uc2.Chrome(options=options,enable_cdp_event=True,executable_path='/home/pablo/Escritorio/chromedriver') 

它会引发以下错误

selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:34959
from session not created: This version of ChromeDriver only supports Chrome version 100
Current browser version is 99.0.4844.84

现在第一次发生我只是通过在 ubuntu 中运行来更新 chrome

sudo apt-get update
sudo apt-get upgrade

现在如果我这样做

google-chrome --version

>>Google Chrome 100.0.4896.60

然而,完全相同的错误正在发生。为什么它指向一个不再存在的 chrome 版本?

【问题讨论】:

    标签: google-chrome ubuntu selenium-chromedriver


    【解决方案1】:

    发生这种情况是因为您尚未更新浏览器。更新铬。

    【讨论】:

    • 以最新版本显示给我
    【解决方案2】:

    我也遇到了同样的问题,我使用“version_main”参数来修复它,例如“version_main=106”作为 uc2.Chrome() 的输入。

    【讨论】:

      猜你喜欢
      • 2022-09-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-27
      • 2019-03-27
      • 2020-10-16
      • 2019-10-06
      • 2020-11-01
      相关资源
      最近更新 更多