小工具知识网

当前位置: 首页 > 行业知识 > Chromedriver最新驱动下载,解决selenium版本不匹配问题

行业知识

Chromedriver最新驱动下载,解决selenium版本不匹配问题

2026-10-22 04:54:09 来源:互联网转载

���新于 2023-12-05 后续国内可能会有同步(镜像),就不会引发该问题

本文基于python3.9 + selenium4.3+webdriver-manager 3.8.6

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

背景

执行selenium代码报错

from selenium import webdriverdriver = webdriver.Chrome()

原因

selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 114Current 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官网推荐的驱动自管理工具库webdriver-manager3.8.6 也失效的,地址也不匹配了。提示如下。

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

更新到webdriver-manager最新版本就ok了

上一篇:Win10语音录音机使用秘籍,轻松掌握录音功能,完美记录你的声音!

下一篇:快手怎么找不到服务器设置?