Chrome116驱动下载路径 解决版本不匹配问题
阅读原文时间:2023年08月23日阅读:1

更新于 2023-08-23 后续可能会有同步,就不会引发该问题

要看解决可以直接看最后的总结

背景

执行selenium代码报错

from selenium import webdriver
driver = webdriver.Chrome()

原因

selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 114
Current browser version is 116.0.5845.97 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe

非常简单的报错,相信大家都会

chrome的地址栏输入chrome://version,自然就得到116.0.5845.97

于是去下载站找对应的驱动

比如https://registry.npmmirror.com/binary.html?path=chromedriver/

但得到的最新版本是114.0.5735.90/

实际也是上面代码关联的驱动版本,这就有点傻眼了。

解决

国内的镜像是定时同步国外的,先看源头

chromedriver官网:https://chromedriver.chromium.org/

下载页:https://chromedriver.chromium.org/downloads

官网最新也是114.0.5735.90/

但这里有这么一句

继续追溯https://chromedriver.chromium.org/downloads/version-selection

看到这样一句

找到第一个链接the Chrome for Testing (CfT) availability dashboard.

对应地址https://googlechromelabs.github.io/chrome-for-testing/

能看到如下信息,是的,新的驱动有win64版本了,以前只有32的。

总结

下载位置:https://googlechromelabs.github.io/chrome-for-testing/

有同学说,可以禁用chrome更新,其实不太建议。

而且,很坑的是,webdriver-manager 这个selenium官网推荐的驱动自管理工具库也失效的,地址也不匹配了。

看来老外也会这样,几个组织之间没有沟通好,约定出了问题。

ValueError: There is no such driver by url https://chromedriver.storage.googleapis.com/LATEST_RELEASE_116.0.5845