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

Undetected Chromedriver在vzu.us遭遇Cloudflare验证循环问题

解决undetected_chromedriver访问vzu.us时的Cloudflare Turnstile验证循环问题

可能的修复方案

  • 增强浏览器伪装参数
    部分网站会检测更细节的自动化特征,可添加更多贴近真实浏览器的启动参数:

    import undetected_chromedriver as uc
    from selenium.webdriver.chrome.options import Options
    
    options = Options()
    options.add_argument("--disable-blink-features=AutomationControlled")
    options.add_argument("--start-maximized")
    options.add_argument("--no-sandbox")
    options.add_argument("--disable-dev-shm-usage")
    options.add_argument("--disable-extensions")
    options.add_experimental_option("excludeSwitches", ["enable-automation"])
    options.add_experimental_option('useAutomationExtension', False)
    
    driver = uc.Chrome(options=options)
    driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: () => undefined})")
    driver.get('https://vzu.us')
    

    这段代码手动移除了navigator.webdriver标识,同时关闭了多个易被检测的自动化相关特性。

  • 验证后增加等待时长
    手动完成验证后页面刷新循环,可能是页面未完成验证状态同步。完成验证后不要立刻操作,等待3-5秒,或者设置全局隐式等待:

    driver.implicitly_wait(10)
    
  • 更新undetected_chromedriver版本
    不同版本的库对Cloudflare规则的适配性不同,执行命令更新到最新版:

    pip install --upgrade undetected-chromedriver
    
  • 使用真实Chrome配置文件
    调用本地真实浏览器的用户配置启动,模拟正常用户环境:

    # 替换为你的Chrome用户数据路径,Windows示例如下
    options.add_argument(r"user-data-dir=C:\Users\你的用户名\AppData\Local\Google\Chrome\User Data")
    options.add_argument(r"profile-directory=Default")
    

    注意启动前关闭本地正在运行的Chrome,避免进程冲突。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.08 23:34:52