selenium执行出现异常,SessionNotCreatedException ChromeDriver only supports

问题现状:

运行程序报错:

selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 114

Current browser version is 121.0.6167.85 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

问题出现原因:

系统的chrome浏览器自动升级了,导致selenium依赖的chrome内核版本不一致造成的问题。

如何解决?

我们只需要去下载一个对应版本的内核chromedriver就行了。

Chrome内核下载页:https://sites.google.com/chromium.org/driver/

进入下载详情页:https://googlechromelabs.github.io/chrome-for-testing/

主要找到对应的版本以及对应自己电脑的版本,记得是下载ChromeDriver,复制那个url,然后直接下载就好了。

下载下来的是一个bin文件

安装只需要配置环境变量就行了:

将chromedriver文件所在路径加入到环境变量PATH里就行,或者直接将文件copy到/usr/local/bin目录也行。

相关推荐
降临-max13 小时前
Selenium(HTML+JavaScript&DOM+Selenium IDE)
自动化测试·selenium·测试工具·html
测试老哥14 小时前
Pytest 之assert断言的使用
自动化测试·软件测试·python·测试工具·测试用例·pytest·接口测试
2601_9622035114 小时前
小白爬虫——selenium入门超详细教程
爬虫·selenium·测试工具
测试199814 小时前
软件测试面试八股文【2026最新版】
自动化测试·软件测试·功能测试·测试工具·面试·职场和发展·测试用例
啊阿狸不会拉杆15 小时前
《计算机网络-自顶向下方法》1.8 小结、课后习题和 Wireshark 实验 读书笔记
计算机网络·测试工具·wireshark
weixin_440730502 天前
selenium实战记录-从登陆-首页-进入应用页面测试用例
selenium·测试工具·测试用例
测试老哥2 天前
Postman获取token并设置token依赖步骤
自动化测试·软件测试·python·测试工具·测试用例·接口测试·postman
我的xiaodoujiao3 天前
Django 基础知识详细图文教程 4-Django 视图定义与使用
开发语言·数据库·后端·测试工具·django·sqlite