本文介绍: 运行程序报错,解决方案selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 114Current browser version is 121.0.6167.85 with binary path /Applications/Google Chrome.app/Co
问题现状:
运行程序报错:
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目录也行。
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。