Browser-Use 浏览器代理

Browser-Use:把 LLM 变成网页操作员的异步 Python 库(Python 3.11+)。Agent 步循环采集 DOM + 截图 → LLM 一次调用产出 thinking / evaluation / next_goal / action[] → 经 CDP 执行。

✓ 0 人报告成功·v0.1.0·

晶体简介

Browser-Use 是把 LLM 变成网页操作员的异步 Python 库(github.com/browser-use/browser-use)。Agent 步循环:(1) 通过 14 个 watchdog 围绕 bubus.EventBus 采集 BrowserStateSummary(带数字索引的 DOM、截图、tab 列表、页面状态);(2) 一次 LLM 调用同时产出 thinking + evaluation_previous_goal + memory + next_goal + action[];(3) 经 CDP 原语在双层 page-change 守卫下执行动作。 CDP 访问走 cdp-use(typed protocol wrapper),不依赖 Playwright。多 LLM 供应商 duck-typed,没有强 vendor 抽象。可选 BROWSER_USE_API_KEY 启用stealth / proxy / captcha 服务。 本 skill 自带 40 条约束(含 4 条 fatal),覆盖典型踩坑:alert/confirm/beforeunload 默认自动接受(含破坏性确认)、sensitive_data 不加 allowed_domains 是 fail-OPEN、SPA URL 不变的 DOM 重渲染绕过 Layer-2 守卫。

Blueprint Source

finance-bp-133

browser-use/browser-usef3878b01 source file

Constraints

4total
4fatal
4 must-not-violate

Evidence Quality

Confidence90%

High confidence — strong evidence base

4 条不可违反的约束

FATALdomain_rule?

WHENWhen designing or coding any browser-use workflow that touches admin tools, file management, settings pages, or any UI where confirm dialogs may guard irreversible operations

ACTIONEither (a) register a custom @tools.action that intercepts dialogs BEFORE popups_watchdog dispatches them (override dispatch order); (b) write a custom watchdog subclassing BaseWatchdog that LISTENS_TO Page.javascriptDialogOpening and overrides should_accept logic with semantic dialog-text classification; or (c) explicitly tell the LLM in the system prompt extension that destructive operations require a separate user-confirmation step recorded in todo.md before any click that could surface a confirm dialog. Document this as a hard prerequisite in your skill — host AI cannot rely on the framework to refuse destructive confirms.

CONSEQUENCEundefined behavior

FATALdomain_rule?

WHENWhen constructing an Agent and passing the sensitive_data parameter (passwords, API keys, PII, financial credentials)

ACTIONWrap Agent construction in your own factory that explicitly raises ValueError if sensitive_data is provided AND browser_profile.allowed_domains is empty/None. Recommended pattern: def make_agent(task, llm, sensitive_data, allowed_domains): assert allowed_domains, 'allowed_domains REQUIRED when sensitive_data set'; return Agent(task=task, llm=llm, sensitive_data=sensitive_data, browser=Browser(allowed_domains=allowed_domains)). Treat the framework's warning as documentation, not as protection.

CONSEQUENCEundefined behavior

FATALdomain_rule?

WHENWhen designing an agent task targeting a SPA — single-page-application, React/Vue/Angular routing, or any site with frequent client-side DOM rerenders that do not change the URL

ACTIONSet max_actions_per_step=1 for SPA-heavy targets so each LLM step is forced to re-read state before the next click. Alternatively, write a custom Layer-3 guard: subclass BaseWatchdog, LISTENS_TO ActionExecutedEvent, run a CDP DOMSnapshot.captureSnapshot pre/post and compare a hash of the interactive subtree; emit a synthetic PageChangedEvent on diff so multi_act breaks. Do NOT trust the default Layer-2 guard for SPA flows.

CONSEQUENCEundefined behavior

常见问题

讨论 (0)

暂无讨论,成为第一个发言的人吧!

更新历史

v0.1.02026-04-25·贡献者: tangweigang-jpg

v0.1.0: 首次发布到 Doramagic.ai。基于 browser-use/browser-use 的 LLM 网页操作员,中英双语 + 40 条 anti-pattern 约束(4 条 fatal)+ 3 条 FAQ。

v0.1.02026-04-25·贡献者: tangweigang-jpg

v0.1.0: 首次发布到 Doramagic.ai。基于 browser-use/browser-use 的 LLM 网页操作员,中英双语 + 40 条 anti-pattern 约束(4 条 fatal)+ 3 条 FAQ。