You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用undetected_chromedriver遇版本不兼容错误,求解决方案

解决undetected_chromedriver与Chrome版本不兼容问题

问题分析

你遇到的错误是因为undetected_chromedriver加载了版本114的ChromeDriver,但本地Chrome浏览器为103.0.5060.53,两者版本不匹配导致冲突。

解决方案

1. 清理ChromeDriver缓存

undetected_chromedriver会自动下载并缓存ChromeDriver,可能旧的114版本缓存未被替换。手动删除缓存目录:

  • Windows:删除%LOCALAPPDATA%\undetected_chromedriver下所有文件
  • Linux/macOS:删除~/.undetected_chromedriver下所有文件

删除后重新运行代码,库会自动下载对应Chrome 103的ChromeDriver。

2. 手动指定ChromeDriver路径

如果自动下载仍异常,可手动下载与Chrome 103.0.5060.53完全匹配的ChromeDriver,再在代码中指定路径:

import undetected_chromedriver as uc
from selenium.webdriver.chrome.service import Service

options = uc.ChromeOptions()    
options.add_argument('--no-sandbox') 
options.add_argument('--disable-dev-shm-usage')
# 替换为你下载的ChromeDriver实际路径
service = Service(executable_path='/your/path/to/chromedriver_103.0.5060.53')
driver = uc.Chrome(options=options, service=service, patcher_force_close=True)
driver.get('https://nowsecure.nl') 
driver.quit()

3. 降级undetected_chromedriver版本

较新版本的undetected_chromedriver可能不再主动支持Chrome 103这类旧版本,可降级到适配版本:
执行命令:

pip install undetected-chromedriver==3.5.3

内容的提问来源于stack exchange,提问作者chens11111010001

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.17 12:35:11