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

Python Undetected_Chrome Driver报HTTPError 404问题求助

修复undetected_chromedriver初始化时的HTTP 404错误
  • 更新undetected_chromedriver到最新版本
    旧版本可能和当前Chrome版本不兼容,导致自动下载驱动时请求的URL失效。执行以下命令升级:
    pip install --upgrade undetected-chromedriver

  • 手动指定Chrome二进制文件路径
    如果系统中Chrome的安装路径不是默认位置,或者存在多个Chrome版本,手动指定路径可避免自动检测出错:

    import undetected_chromedriver as uc
    options = uc.ChromeOptions()
    # Windows示例路径
    options.binary_location = "C:/Program Files/Google/Chrome/Application/chrome.exe"
    # Linux示例路径
    # options.binary_location = "/usr/bin/google-chrome"
    driver = uc.Chrome(options=options)
    
  • 手动下载匹配版本的ChromeDriver并指定路径
    跳过自动下载流程,直接下载与本地Chrome版本完全匹配的ChromeDriver(主版本号一致即可,如Chrome 118对应ChromeDriver 118.x.x.x),初始化时指定驱动路径:

    import undetected_chromedriver as uc
    driver = uc.Chrome(executable_path="/path/to/your/chromedriver.exe")
    
  • 检查网络环境
    自动下载驱动时可能被代理、防火墙拦截导致404,尝试关闭代理或切换到稳定网络后再初始化实例。

  • 清除undetected_chromedriver缓存
    旧缓存的驱动文件可能引发路径错误,找到缓存目录删除后重试:

    • Windows:%LOCALAPPDATA%/undetected_chromedriver
    • Linux/macOS:~/.undetected_chromedriver

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.29 21:37:02