Skip to content

Camoufox 无法检测到 AI Studio 页面输入元素 - 选择器超时 #306

Description

@Broxiao

环境:

• macOS (Apple Silicon)
• Python 3.10
• Camoufox 版本: 146.0.1-beta.25
• 项目版本: 最新 main 分支

问题描述: 项目启动时无法检测到 Google AI Studio 页面的输入元素,导致初始化失
败。错误发生在 --headless 和 --debug 两种模式下。

复现步骤:

  1. 克隆最新代码
  2. 配置 .env 文件(设置代理等)
  3. 运行 poetry run python launch_camoufox.py --headless
  4. 页面导航成功,但选择器超时

错误日志:

11:16:02.320 INF LNCHR [浏览器] 已连接 (版本: 146.0.1-beta.25)
11:16:02.320 INF LNCHR [浏览器] 上下文已创建 (Auth: auth_auto_17552277
82.json)
11:16:02.718 INF LNCHR [导航] 打开新页面: https://aistudio.google.com/
prompts/new_chat
11:16:45.956 WRN LNCHR [Selector] 输入容器: 所有选择器均未找到可见元 …
(尝试了 5 个选择器)
11:16:45.990 ERR LNCHR 页面初始化失败:核心输入区域未在预期时间内变为
可见。最后的 URL 是 https://aistudio.google.com/prompts/new_chat

RuntimeError: 无法找到输入容器元素。已尝试的选择器: ms-chunk-editor, ms-prompt
-input-wrapper .prompt-input-wrapper, ms-prompt-input-wrapper, ms-prompt-box .
prompt-box-container, ms-prompt-box

诊断结果:

  1. 使用原生 Playwright Chromium(无头模式):正常工作,可以检测到 textarea[ari
    abel="Enter a prompt"] 元素
  2. 使用 Camoufox(无头/可见模式):无法找到元素

页面实际 HTML 结构(从错误快照中提取):

<textarea aria-label="Enter a prompt" class="cdk-textarea-autosize textarea ng -untouched ng-pristine ng-valid"></textarea>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions