selenium报错:This version of ChromeDriver only supports Chrome version 109 Current browser version is 112.0.5615.49...解决办法
前言:跟GPT交互,让其写一段代码,执行失败。经过排查验证,GPT写的代码没有问题,是本地环境问题。
执行报错:
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 109
Current browser version is 112.0.5615.49 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe
报错分析:
此版本的ChromeDriver 仅支持Chrome版本109。当前浏览器版本为112.0.5615.49 。根据报错得知本地的谷歌浏览器已经更新。
解决办法:
将与谷歌浏览器版本匹配的chromedriver.exe放到Python的安装目录下,也就是和python.exe同目录即可。
详细过程,如下:
1. 让cursor写一段python代码,如下:
from selenium import webdriver # Create a new Chrome browser instance
browser = webdriver.Chrome() # Navigate to the Baidu homepage
browser.get('https://www.baidu.com/') # Wait for the page to load
browser.implicitly_wait(10) # Take a screenshot of the page and save it to a file
browser.save_screenshot('baidu_screenshot.png') # Close the browser
browser.quit()
2. 在pycharm运行报错,如下:
"D:\Program Files\python3\python.exe" "D:\Program Files\python3\Zyl\2023-04-11\demo11.py"
Traceback (most recent call last):
File "D:\Program Files\python3\Zyl\2023-04-11\demo11.py", line 4, in <module>
browser = webdriver.Chrome()
File "D:\Program Files\python3\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 81, in __init__
super().__init__(
File "D:\Program Files\python3\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 106, in __init__
super().__init__(
File "D:\Program Files\python3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 288, in __init__
self.start_session(capabilities, browser_profile)
File "D:\Program Files\python3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 381, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "D:\Program Files\python3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 444, in execute
self.error_handler.check_response(response)
File "D:\Program Files\python3\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 249, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 109
Current browser version is 112.0.5615.49 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe
Stacktrace:
Backtrace:
(No symbol) [0x005B6643]
(No symbol) [0x0054BE21]
(No symbol) [0x0044DA9D]
(No symbol) [0x00472911]
(No symbol) [0x0046D630]
(No symbol) [0x0046A899]
(No symbol) [0x004A6917]
(No symbol) [0x004A655C]
(No symbol) [0x0049FB76]
(No symbol) [0x004749C1]
(No symbol) [0x00475E5D]
GetHandleVerifier [0x0082A142+2497106]
GetHandleVerifier [0x008585D3+2686691]
GetHandleVerifier [0x0085BB9C+2700460]
GetHandleVerifier [0x00663B10+635936]
(No symbol) [0x00554A1F]
(No symbol) [0x0055A418]
(No symbol) [0x0055A505]
(No symbol) [0x0056508B]
BaseThreadInitThunk [0x76C37D49+25]
RtlInitializeExceptionChain [0x774CB74B+107]
RtlClearBits [0x774CB6CF+191] Process finished with exit code 1
3. 配置谷歌驱动
谷歌驱动下载地址:http://chromedriver.storage.googleapis.com/index.html
驱动版本须与浏览器版本一致。
将下载好的浏览器驱动解压,将解压出的 exe 文件替换到Python的安装目录下,也就是和python.exe同目录即可。
4. 再次执行代码,执行成功。
"D:\Program Files\python3\python.exe" "D:\Program Files\python3\Zyl\2023-04-11\demo11.py" Process finished with exit code 0

selenium报错:This version of ChromeDriver only supports Chrome version 109 Current browser version is 112.0.5615.49...解决办法的更多相关文章
- UI自动化执行时报Parent suite setup failed: SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81报错的问题解决
持续集成在执行UI时报错:Parent suite setup failed: SessionNotCreatedException: Message: session not created: Th ...
- asp.net报错“尝试读取或写入受保护的内存。这通常指示其他内存已损坏”的解决办法
来源:http://ajxfxb.blog.163.com/blog/static/56675086201411634336878/ 作者是:没完没了的工作 asp.net报错“尝试读取或写入受保护的 ...
- win 2012 安装mysql 5.7.20 及报错 This application requires Visual Studio 2013 Redistributable. Please install the Redistributable then run this installer again 的解决办法
本文地址:http://www.cnblogs.com/jying/p/7764147.html 转载请注明出处. 安装过程其实挺简单,基本上下一步下一步,可以参考我的另一篇mysql安装文章: ...
- Selenium chromeDriver启动时报错:session not created: This version of ChromeDriver only supports Chrome
解决方案: 这是因为ChromeDriver与本地chrome浏览器的版本不一致导致 ChromeDriver下载地址:http://npm.taobao.org/mirrors/chromedriv ...
- 运行python代码报错UnicodeDecodeError: 'ascii' codec can't decode byte 0xe7 in position 91: ordinal not in range(128)的解决办法
1.通过搜集网上的资料,自己多次尝试,问题算是解决了,在代码中加上如下几句即可: import sys reload(sys) sys.setdefaultencoding('utf-8') 2.原因 ...
- vue引入fastclick设置输入框type="number"报错Failed to execute 'setSelectionRange' on 'HTMLInputElement': The input element's type ('number') does not support selection.的解决办法
将输入框type设为text,通过正则验证输入的值
- 解决centos7下 selenium报错--unknown error: DevToolsActivePort file doesn't exist
解决centos7下 selenium报错--unknown error: DevToolsActivePort file doesn't exist 早上在linux下用selenium启动Chro ...
- selenium报错以及各解决方法
1.driver.findElement(By.name("wd")).sendKeys("selenium"); 报错:The method sendKeys ...
- Selenium报错:StaleElementReferenceException
一个学生在操作页面跳转时遇到一个Selenium报错, 如下图所示: StaleElementReferenceException: Message: stale element reference: ...
- selenium报错汇总
selenium报错汇总 报错:[error] Could not connect to Selenium Server. Have you started the Selenium Server y ...
随机推荐
- #AI 1分钟学会,利用AI制作思维导图 (NewBing&X-Mind )
思维导图是一种有效的思考和学习工具,它可以帮助你整理和呈现信息,激发你的创造力和记忆力.但是,传统的思维导图软件往往需要你花费大量的时间和精力来设计和绘制,而且难以修改和分享.有没有一种更简单和智能的 ...
- Vue2积分商城项目
一.清空项目非必要文件和用户片段,路径提示的配置 views 下面的文件只保留 Home.vue ,其余删除,删除 components/HelloWorld.vue,并且 Home.vue 中不再引 ...
- 2023-03-13:给定一个整数数组 A,坡是元组 (i, j),其中 i < j 且 A[i] <= A[j], 这样的坡的宽度为 j - i。 找出 A 中的坡的最大宽度,如果不存在,返回 0
2023-03-13:给定一个整数数组 A,坡是元组 (i, j),其中 i < j 且 A[i] <= A[j], 这样的坡的宽度为 j - i. 找出 A 中的坡的最大宽度,如果不存在 ...
- 2022-09-20:以下go语言代码输出什么?A:8 8;B:8 16;C:16 16;D:16 8。 package main import ( “unsafe“ “fmt“ )
2022-09-20:以下go语言代码输出什么?A:8 8:B:8 16:C:16 16:D:16 8. package main import ( "unsafe" " ...
- 从零玩转之JPOM自动化部署本地构建 + SSH 发布 java 项目
简而轻的低侵入式在线构建.自动部署.日常运维.项目监控软件 一键部署Jpom 本文主要介绍: 如何从零开始使用一键安装的方式安装 Jpom 服务端+插件端配置 本文中服务端和插件端是安装在同一个服务器 ...
- AcWing900.整数划分(python)
题目详情 知识点 计数类DP 分析题目,k个数是默认排好序的,也就是说,对于划分我们的考虑是无序的:例如 4 = 1+1+2 4 = 1+2+1 4 = 2+1+1 以上三种方式是没有区别的,所以在求 ...
- SpringMVC 后台从前端获取单个参数
1.编写web.xml(模板) 2.springmvc配置文件 3.编写对应数据库字段的pojo实体类 @Data @AllArgsConstructor @NoArgsConstructor pub ...
- 荣登国家级榜单!ShowMeBug创始人李亚飞入选「科创中国·青年创业榜」
近日,中国科协召开2022"科创中国"年度会议,会上发布了2021"科创中国"系列榜单.其中,ShowMeBug 创始人&CEO李亚飞入选2021年科创 ...
- Android strings.xml按照key修改
strings.xml匹配替换 将两个Android项目中的多语言字符串文件(strings.xml)进行比较,如果其中一个项目中包含另一个项目没有的字符,则合并到单一的输出文件,并以 key 在原始 ...
- Java 实战介绍 Cookie 和 Session 的区别
HTTP 是一种不保存状态的协议,即无状态协议,HTTP 协议不会保存请求和响应之间的通信状态,协议对于发送过的请求和响应都不会做持久化处理. 无状态协议减少了对服务压力,如果一个服务器需要处理百万级 ...