スキル一覧に戻る
wormholecowboy

agent-browser

by wormholecowboy

My .dotfiles config

0🍴 0📅 2026年1月24日
GitHubで見るManusで実行

SKILL.md


name: agent-browser description: Headless browser automation via CLI for web scraping, UI testing, and automated workflows. Use when tasks require navigating websites, interacting with page elements (clicking, typing, form filling), taking screenshots, verifying page content, or performing end-to-end browser automation. Assumes agent-browser is installed globally.

Agent Browser

Control a headless browser via CLI. Use --json flag for machine-readable output.

Core Workflow

  1. Navigate to target URL
  2. Snapshot to get accessibility tree with element refs (@e1, @e2, etc.)
  3. Act using refs for deterministic element selection
  4. Re-snapshot after page changes
agent-browser open "https://example.com"
agent-browser snapshot -i -c    # interactive elements only, compact
agent-browser click @e3
agent-browser snapshot -i -c    # re-snapshot after interaction

Selectors

Prefer refs from snapshots for reliability:

  • @e1 - Ref from accessibility tree (most reliable)
  • text=Submit - By text content
  • #id / .class - CSS selectors
  • xpath=//button - XPath

Common Patterns

Form Interaction

agent-browser fill @e5 "user@example.com"
agent-browser fill @e6 "password123"
agent-browser click @e7
agent-browser wait --url "/dashboard"

UI Verification

agent-browser is visible "#success-message"
agent-browser get text ".error-message"
agent-browser get count ".list-item"
agent-browser get attr @e2 "disabled"

Screenshots & PDFs

agent-browser screenshot ./page.png
agent-browser screenshot --full ./fullpage.png
agent-browser pdf ./document.pdf

Wait Patterns

agent-browser wait "#loading"              # Wait for element
agent-browser wait 2000                    # Wait ms
agent-browser wait --text "Success"        # Wait for text
agent-browser wait --load networkidle     # Wait for network

Sessions (Parallel Isolation)

agent-browser --session test1 open "https://example.com"
agent-browser --session test2 open "https://other.com"
agent-browser session list

Authentication

# Set headers for API auth
agent-browser --headers '{"Authorization": "Bearer token"}' open "https://api.example.com"

# Save/restore auth state
agent-browser state save ./auth.json
agent-browser state load ./auth.json

Network Mocking

agent-browser network route "**/api/users" --body '{"users": []}'
agent-browser network route "**/ads/*" --abort

Snapshot Tips

FlagPurpose
-iInteractive elements only (buttons, inputs, links)
-cCompact output, removes empty containers
-d 3Limit depth to 3 levels
-s "#main"Scope to specific container

Always use -i -c for cleaner output when interacting.

Reference

Full command reference: references/commands.md

スコア

総合スコア

40/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です