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

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

相关推荐
gc_22991 天前
使用HtmlAgilityPack+PuppeteerSharp+iText7抓取Selenium帮助文档
selenium·itext7·htmlagilitypack·puppeteersharp
代码小念3 天前
Pytest+selenium UI自动化测试实战实例(超详细)
selenium·ui·pytest
NEUMaple5 天前
python爬虫(三)----Selenium
爬虫·python·selenium
@Aurora.6 天前
【接口自动化测试】---YAML、JSON Schema
selenium·单元测试·测试用例·压力测试·postman·ab测试·测试覆盖率
Ai财富密码6 天前
Python 爬虫:Selenium 自动化控制(Headless 模式 / 无痕浏览)
爬虫·python·selenium
无职转生真好看6 天前
Selenium动态元素定位
selenium·测试工具
草药味儿の岁月7 天前
系统测试讲解 - Java使用selenium实现滑块验证的处理详解
java·python·selenium
码农派大星。9 天前
Selenium在Pyhton应用
python·selenium·测试工具
要长脑子了95610 天前
【论坛系统自动化功能测试报告】
运维·python·功能测试·selenium·pycharm·自动化·模块测试