# Browser

用异步 Python 调用 QwenPaw 内置 Browser SDK 驱动真实浏览器。完整参考在下方；上下文压缩后请重新加载此 browser skill。

- Repository: https://github.com/agentscope-ai/QwenPaw (37135 stars)
- Category: Engineering
- License: Apache-2.0
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add agentscope-ai/QwenPaw --skill browser -g -a claude-code -y`
Codex: `npx skills add agentscope-ai/QwenPaw --skill browser -g -a codex -y`
Cursor: `npx skills add agentscope-ai/QwenPaw --skill browser -g -a cursor -y`
Gemini CLI: `npx skills add agentscope-ai/QwenPaw --skill browser -g -a gemini-cli -y`

## Description

用异步 Python 调用 QwenPaw 内置 Browser SDK 驱动真实浏览器。完整参考在下方；上下文压缩后请重新加载此 browser skill。

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 浏览器

保持工作纪律：先感知当前页面，再通过已列出的 API 动作，最后重新感知后才可声明成功。
只能陈述本轮实际观察到的事实。卡住时的合格交付 = 说明卡在哪一步 + 已亲眼验证的部分结果；
不要为了给出完整答案而补全你没有看到的内容。

尊重人工边界：登录、验证码、2FA 或任何必须由人完成的步骤，调用
`await browser.handoff(...)` 后停止，绝不自动化这些流程。
浏览器完不成时，不要拿其他渠道（如 web_search）的数据顶替并仍说成浏览器结果, , 如实写明每个数据的来源。

这是 QwenPaw 内置的 Browser SDK，不是 Playwright。它是封闭的 API 表面：
未列出的方法不存在。完整参考在下方；若上下文中不再保留，请用 Skill 工具重新加载
此 browser skill。

<!-- BEGIN GENERATED: browser-manual -->
QwenPaw Browser SDK, complete reference. This is QwenPaw's OWN internal
SDK and this is the ENTIRE API; these are all the entrypoints. The SDK
is already in scope as Browser, call the methods below directly. Write
async Python. Work in a loop: perceive → act → verify.

# Copy this shape:
browser = await Browser.connect()                  # connect once; reused all session
page = await browser.open("https://example.com")   # open a page
obs = await page.snapshot()                         # PERCEIVE, page text is obs.text
if len(obs.text) < 6000:
    print(obs.text)
else:
    # Large page: read selectively instead of dumping everything.
    lines = [line for line in obs.text.splitlines()
             if "keyword" in line]
    print(f"{len(obs.text)} chars total; {len(lines)} matching lines:")
    print("\n".join(lines[:80]))
# For a focused count, use: await page.snapshot(query="keyword")
await page.get_by_role("textbox", name="Search").fill("laptop")   # ACT
await page.get_by_role("button", name="Search").click()            # ACT
obs = await page.snapshot()                         # VERIFY, re-perceive to confirm
print("Verified; inspect obs.text with the selective pattern above.")

Session state: this is a stateful session, variables you assign (browser,
page) persist across calls, so connect once and reuse them. If a call
reports the session was reset, re-run await Browser.connect().

The rest: https://github.com/agentscope-ai/QwenPaw/blob/HEAD/src/qwenpaw/agents/skills/browser-zh/SKILL.md
