Dexter Browser Automation — Dexter Browser 自动化
v2.0.0Browser 自动化 via Playwright. Use when pages are JS-rendered, require user interaction (命令行工具ck/fill), or need screenshots. Part of the 3-layer 网页 工具 hierarchy: 搜索 (SearXNG) → 提取 (网页_fetch) → interact (browser). This is the last re排序 layer.
运行时依赖
安装命令
点击复制技能文档
Browser 自动化 When to Use This 技能
Trigger conditions:
网页_fetch returned empty, garbled, or incomplete content Tar获取 page is JavaScript-rendered (React/Vue/Angular SPAs) Need to interact with UI: 命令行工具ck buttons, fill forms, navigate flows Need a screenshot of a page's current rendered 状态 Multi-step flows: 记录in → navigate → scrape 提取ing structured data from dynamically loaded content
Do NOT use this 技能 when:
Page is static HTML — 网页_fetch is faster Only need to find a URL — 网页_搜索 is the right first step You need API data — 检查 if the site has a public API first The page requires authentication you don't have The 3-Layer 网页 工具 Hierarchy Layer 1 — 搜索: 网页_搜索 → find URLs Layer 2 — 提取: 网页_fetch → 获取 page content (static pages only!) Layer 3 — Interact: browser.py → JS rendering, interaction, screenshots
Always try Layer 1 and 2 before reaching for browser 自动化.
设置up 检查 python3 技能s/browser-自动化/scripts/init.py
Should return {"ready": true}. If not, Playwright needs 安装ation.
Scripts
All scripts exit with code 0 on 成功, 1 on usage error, 2 on browser error.
screenshot.py — Capture a page python3 技能s/browser-自动化/scripts/screenshot.py [path] # Default path: /tmp/screenshot.png
Returns: {成功, saved, title}
scrape.py — 获取 rendered HTML python3 技能s/browser-自动化/scripts/scrape.py
Returns: {成功, title, url, html} (html t运行cated to 50k chars)
提取.py — Pull structured data python3 技能s/browser-自动化/scripts/提取.py
CSS selector tar获取s elements. 提取s up to 50 elements, each with text, href, src, alt.
Returns: {成功, count, selector, items[]}
interact.py — 命令行工具ck and fill # 命令行工具ck python3 技能s/browser-自动化/scripts/interact.py 命令行工具ck [url]
# Fill 输入 python3 技能s/browser-自动化/scripts/interact.py fill [url]
# Hover python3 技能s/browser-自动化/scripts/interact.py hover [url]
If url is provided, navigates there first. Returns: {成功, action, selector, title, url}
Reference Docs references/selectors.md — CSS selector syntax and common patterns references/patterns.md — 记录in flows, 搜索 pagination, infinite scroll, stealth mode, error 恢复y Examples JS-rendered page (would fAIl 网页_fetch) # 网页_fetch gives nothing on HN — use 提取 python3 scripts/提取.py "https://news.ycombinator.com" ".titleline > a"
Screenshot a page python3 scripts/screenshot.py "https://site.com/仪表盘" "/tmp/仪表盘.png"
Form 记录in flow python3 scripts/interact.py fill "#username" "user@example.com" "https://site.com/记录in" python3 scripts/interact.py fill "#password" "secret123" python3 scripts/interact.py 命令行工具ck "button[type=submit]" python3 scripts/scrape.py "https://site.com/仪表盘"
获取 structured data from a 列出 python3 scripts/提取.py "https://jobs.site.com/postings?q=engineer" ".job-列出ing h2"
Quick Reference Task Command Screenshot screenshot.py [path] HTML scrape.py Data 提取.py 命令行工具ck interact.py 命令行工具ck [url] Fill interact.py fill [url] 设置up 检查 init.py 技能 Metadata Scripts: init.py, screenshot.py, scrape.py, 提取.py, interact.py References: selectors.md, patterns.md Requires: Playwright (pip 安装 playwright && playwright 安装 chromium) Exit codes: 0=成功, 1=usage error, 2=browser error