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的下载链接,如下图所示:

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

相关推荐
han68893 小时前
selenium之实战
笔记·python·selenium·测试工具·自动化
Madison-No79 小时前
多语言聊天大模型--测试报告
linux·git·python·selenium·jmeter·自动化·postman
落魄大学生之流水线上谋生计4 天前
Selenium 入门到实战:用 Python 写出稳定的浏览器自动化
python·selenium·自动化
禹凕11 天前
机器学习之Selenium(Machina Learning about Selenium)
爬虫·python·selenium·测试工具·机器学习
把头塞进显示器20 天前
电商平台-测试报告
python·selenium·pytest
2601_962295331 个月前
如何python实现网页的自动化
python·selenium·beautifulsoup·requests·网页自动化
程序员小远1 个月前
自动化测试用例编写实例详解
自动化测试·软件测试·python·selenium·测试工具·职场和发展·测试用例
2601_962298271 个月前
Python与Selenium结合的Web自动化测试全流程实践教程
自动化测试·python·selenium·web测试·pageobjectmodel
2601_962298271 个月前
【自动化测试】基于Selenium + Python的web自动化框架
自动化测试·python·selenium·测试用例·web框架