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目录也行。

相关推荐
Ctrl С1 小时前
[三分钟]入门web自动化测试(一):1.使用驱动管理下载web驱动(WebDriver);2.初步认识和使用Selenium
selenium·测试工具·自动化·web
HtwHUAT2 小时前
二、UI自动化测试02--元素定位方法
笔记·python·selenium·ui
??? Meggie6 小时前
【Python】保持Selenium稳定爬取的方法(防检测策略)
开发语言·python·selenium
半路_出家ren1 天前
流量抓取工具(wireshark)
网络·网络协议·测试工具·网络安全·wireshark·流量抓取工具
猿周LV1 天前
JMeter 安装及使用 [软件测试工具]
java·测试工具·jmeter·单元测试·压力测试
西柚小萌新2 天前
【Python爬虫基础篇】--4.Selenium入门详细教程
爬虫·python·selenium
??? Meggie2 天前
Selenium 怎么加入代理IP,以及怎么检测爬虫运行的时候,是否用了代理IP?
爬虫·tcp/ip·selenium
天才测试猿2 天前
软件测试之功能测试详解
自动化测试·软件测试·python·功能测试·测试工具·职场和发展·测试用例
HtwHUAT2 天前
五、web自动化测试01
前端·css·chrome·python·功能测试·selenium·html
远方2352 天前
应用信息1.13.0发布
测试工具·安全·apk·开发工具·应用·工具·信息