爬虫时报错Message: This version of ChromeDriver only supports Chrome version xx

发生这种情况大部分原因是因为Google浏览器的自动更新,导致chromedriver.exe版本和Google浏览器版本不一致,有两种解决办法。
1.将Google浏览器版本降级为chromedriver.exe对应的版本
2.将chromedriver.exe升级为Google浏览器对应的版本

下面的解决办法基于第二种

Step1 查看Google版本,地址栏输入Chrome://version,回车,可以看到版本为90.0.4430
在这里插入图片描述

Step2 打开chromedriver镜像网址,找到对应版本的chromedriver.exe下载下来

在这里插入图片描述
在这里插入图片描述

Step3 将下载的chromedriver.exe放到python解释器同级目录里,比如我这里使用的是anaconda自带的python解释器
在这里插入图片描述

问题就解决了
PS:如果想永久关闭google自动更新的话,请参考博文

参考的原文链接:https://blog.csdn.net/qq_41605934/article/details/116330227

DevTools listening on ws://127.0.0.1:60973/devtools/browser/30601eef-2302-4bf3-8903-938a20d56681 Traceback (most recent call last): File "e:/爬虫基础/pc0526.py", line 14, in <module> driver = webdriver.Chrome() File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 70, in __init__ super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog", File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 92, in __init__ RemoteWebDriver.__init__( File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 275, in __init__ self.start_session(capabilities, browser_profile) File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 365, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 430, in execute self.error_handler.check_response(response) File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 247, 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 112 Current browser version is 114.0.5735.110 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe Stacktrace: Backtrace: GetHandleVerifier [0x0030DCE3+50899] (No symbol) [0x0029E111] (No symbol) [0x001A5588] (No symbol) [0x001C570C] (No symbol) [0x001C1471] (No symbol) [0x001BF479] (No symbol) [0x001F1FFE] (No symbol) [0x001F1CEC] (No symbol) [0x001EB6F6] (No symbol) [0x001C7708] (No symbol) [0x001C886D] GetHandleVerifier [0x00573EAE+2566302] GetHandleVerifier [0x005A92B1+2784417] GetHandleVerifier [0x005A327C+2759788] GetHandleVerifier [0x003A5740+672048] (No symbol) [0x002A8872] (No symbol) [0x002A41C8] (No symbol) [0x002A42AB] (No symbol) [0x002971B7] BaseThreadInitThunk [0x76BC00C9+25] RtlGetAppContainerNamedObjectPath [0x77497B4E+286] RtlGetAppContainerNamedObjectPath [0x77497B1E+238] (No symbol) [0x00000000]
06-07
根据引用、[2]和的内容,"Message: session not created: This version of ChromeDriver only supports Chrome version 104"是由于ChromeDriver版本不兼容Chrome浏览器版本导致的。实际上,ChromeDriver只支持特定版本的Chrome浏览器。在这种情况下,你需要使用与你的Chrome浏览器版本兼容的ChromeDriver版本。 解决这个问题的方法是通过下载和使用适用于你Chrome浏览器版本的ChromeDriver。你可以在Selenium的官方网站上找到与你Chrome浏览器版本相对应的ChromeDriver下载链接。确保下载的ChromeDriver版本与你Chrome浏览器的版本完全匹配。 一旦你下载了适合你Chrome浏览器版本的ChromeDriver,并将其放置在正确的目录下,你就可以重新运行你的Selenium脚本,这样就不会再出现"Message: session not created: This version of ChromeDriver only supports Chrome version 104"的错误了。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [chromedriverchrome版本不匹配导致无法运行selenium解决办法](https://download.csdn.net/download/weixin_38589314/14035584)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [Message: session not created: This version of ChromeDriver only supports Chrome version 98](https://blog.csdn.net/m0_65833575/article/details/124728943)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [处理session not created: This version of ChromeDriver only supports Chrome version问题的方法](https://blog.csdn.net/weixin_46308904/article/details/109306234)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值