所以,我的代码如下
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 中运行来更新 chromesudo apt-get update
sudo apt-get upgrade
现在如果我这样做google-chrome --version
>>Google Chrome 100.0.4896.60
然而,完全相同的错误正在发生。为什么它指向一个不再存在的 chrome 版本?
最佳答案
发生这种情况是因为您尚未更新浏览器。更新 Chrome。
关于google-chrome - selenium.common.exceptions.WebDriverException : Message: unknown error: cannot connect to chrome at 127. 0.0.1:36059 Ubuntu 20 LTS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71681599/