Chrome自动升级了,找不到最新版本的webdriver怎么办?

Chrome自动升级了,找不到最新版本的webdriver怎么办?

背景

我用Selenium开发了Facebook和Linkedin爬虫,有些新需求要调一下,今天启动selenium时有报错,报错如下:selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version xxx Current browser version is xxx with binary path,意思是Webdriver的版本与Chrome浏览器的版本不兼容,于是上网查了chrome webdirver的下载地址,大部分技术博客里分享的下载地址都是:https://chromedriver.storage.googleapis.com/index.html,但我看了,本地chrome的版本是116,而这个网址里最新的webdriver版本是114,那么办呢?

解决办法

我想起来神通广大的chatgpt,于是向chatgpt提问了,没想到它真的知道解决办法,它回复我的是另外一个网址,下面是它完整的回复:

您可以从Chrome驱动程序官方网站或其他可信的资源库中获取特定版本的Chrome WebDriver。
以下是一些常用的资源:
Chrome驱动程序官方网站:您可以访问Chrome开发者页面,找到与特定Chrome版本兼容的Chrome WebDriver下载链接。您可以在https://sites.google.com/a/chromium.org/chromedriver/downloads找到Chrome驱动程序官方网站 ↗。
第三方WebDriver资源库:一些第三方资源库也提供不同版本的Chrome WebDriver下载。例如,您可以尝试Selenium官方网站(https://www.selenium.dev/ ↗)或GitHub上的Selenium项目页面(https://github.com/SeleniumHQ/selenium ↗)。
在这些资源中,您可以查找与您所需的Chrome版本相匹配的Chrome WebDriver版本,并下载相应的WebDriver安装文件。
请注意,确保从可信的来源下载WebDriver,并验证其完整性,以确保安全性和可靠性。

打开 https://sites.google.com/a/chromium.org/chromedriver/downloads,上面可以看到一行提示:

是的,新版本但可能还不够成熟稳定的webdriver版本在这里可以找到,点击链接 https://googlechromelabs.github.io/chrome-for-testing/ 就可以看到最新的116版本的webdriver的下载链接,如下图所示:

找到适合自己的版本下载就可以了,问题解决!!!

相关推荐
深蓝电商API5 小时前
实战破解前端渲染:当 Requests 无法获取数据时(Selenium/Playwright 入门)
前端·python·selenium·playwright
卓码软件测评5 小时前
第三方软件验收测试:【AutoIt与Selenium结合测试文件上传/下载等Windows对话框】
windows·功能测试·selenium·测试工具·性能优化·可用性测试
最好的我们!14 小时前
解决selenium的EdgeOptions addArguments is not supported问题
selenium·测试工具
万粉变现经纪人1 天前
如何解决 pip install 安装报错 ImportError: cannot import name ‘xxx’ from ‘yyy’ 问题
python·selenium·测试工具·flask·scikit-learn·fastapi·pip
gc_22991 天前
学习Python中Selenium模块的基本用法(18:使用ActionChains操作鼠标)
python·selenium
paid槮3 天前
selenium完整版一览
selenium·测试工具
gc_22993 天前
学习Python中Selenium模块的基本用法(17:使用ActionChains操作键盘)
python·selenium
鱼鱼说测试3 天前
Selenium+python自动化1-环境搭建
python·selenium·自动化
Moshow郑锴3 天前
Java 中配置 Selenium UI 自动化测试 并生成 Cucumber 报告
java·selenium·测试工具
llm2009093 天前
UI自动化框架之Selenium八大元素定位(二)
selenium·ui·自动化