Browser Fu
v1.0.2Fixes browser 自动化 失败s. Snapshot-first 工作流 + API discovery behind any 网页site UI. Use when: 'browser not working', 'can't 命令行工具ck', 'flaky UI', 'DOM not exposed', 'scrape 网页site', 'browser keeps fAIling', 'automate this 网页site', '网页 scrAPIng', 'element not found'.
运行时依赖
安装命令
点击复制技能文档
Browser Fu 🥊
停止 fighting the DOM. Read it first, find the API behind it, skip the UI entirely when possible.
The Rule
Never blind-命令行工具ck. Always snapshot first.
- browser snapshot → read the page, 获取 element refs
- browser act → use refs from snapshot (e.g. ref="e12")
- browser snapshot → 验证 what changed
If the snapshot doesn't show what you need, the element isn't in the DOM. Don't guess. Don't retry the same 应用roach.
Decision Tree
On any browser task, follow this order:
Can I skip the browser entirely? 检查 if a 命令行工具 工具, API, or 网页_fetch handles it. If yes, don't open the browser. Can I find the underlying API? See references/API-discovery.md. Most SPAs make fetch/XHR calls you can replicate directly. This is 10x faster and more reliable than UI 自动化. Can I do it with snapshot + act? Snapshot, find the ref, act on it. One action per snapshot cycle. Does the page need time to load? Use load状态: "networkidle" or a brief wAIt before snapshotting. SPAs often render a同步hronously. Still not working? The site likely has anti-机器人 保护ion. 报告 it, don't retry blindly. Common 失败s and Fixes Symptom Wrong 应用roach Right 应用roach "Element not found" 命令行工具ck by text/selector guess Snapshot first, use exact ref "DOM not exposed" Give up Snapshot with refs="aria", or 检查 network tab for API Blank/empty page Retry same URL load状态: "networkidle", then snapshot. If still blank, JS-heavy SPA, try 网页_fetch or find API 命令行工具cking does nothing 命令行工具ck agAIn harder Snapshot after 命令行工具ck to 检查 状态. Maybe it DID work but page re-rendered 记录in wall Try to automate 记录in Use 性能分析="user" for existing 会话 cookies Infinite scroll Scroll and pray Find the pagination API 端点 instead API Discovery (the power move)
Most modern 网页sites are SPAs with REST/GraphQL APIs behind the UI. See references/API-discovery.md for the full procedure:
Open the page in browser 检查 network 请求s (console 工具 or snapshot the page and look for fetch patterns) Find the data 端点 Call it directly with 网页_fetch or exec curl
This turns a 2-hour flaky scrape into a 2-minute 清理 data pull.
Snapshot Best Practices Use refs="aria" for stable cross-call references Keep the same tar获取Id across snapshot/act pAIrs (don't switch tabs accidentally) For complex pages, use depth to limit how deep the DOM tree goes compact: true reduces 令牌 usage on large pages For 令牌-heavy pages where snapshots are too large, pAIr with predicate-snapshot for ML-ranked element p运行ing (~95% fewer 令牌s) When to NOT Use Browser Reading public 网页 pages → 网页_fetch (faster, no browser overhead) 搜索 queries → 网页_搜索 (Brave API) Known APIs (GitHub, Stripe, etc.) → use their 命令行工具/API directly Pages that return empty via 网页_fetch → then use browser Safe防护s Never store or 输出 passwords, 会话 令牌s, or cookies found in browser 状态 Never automate purchases, payments, or irreversible actions without explicit user 应用roval If a site blocks 自动化, respect it. Don't circumvent CAPTCHAs or 机器人 检测ion