| name | agent-browser |
| description | agent-browser(Rust製ヘッドレスブラウザCLI)を使ったブラウザ自動化。Webページの操作、スクレイピング、フォーム入力、スクリーンショット取得、E2Eテスト的な操作を行うときに使用する。 |
agent-browser
AIエージェント向けの高速なRust製ヘッドレスブラウザCLI。インストール済み。
基本操作
agent-browser open <url>
agent-browser snapshot
agent-browser screenshot [path]
要素の検索
セマンティックロケータで要素を特定する:
agent-browser find role button --name "Submit"
agent-browser find text "ログイン"
agent-browser find label "メールアドレス"
agent-browser find placeholder "検索"
agent-browser find testid "submit-btn"
操作
agent-browser click <selector>
agent-browser fill <selector> <text>
agent-browser press Enter
agent-browser scroll --dy 500
データ取得
agent-browser get url
agent-browser get text <selector>
agent-browser get attr <selector> <attr>
待機
agent-browser wait <selector>
agent-browser wait --text "完了"
agent-browser wait --load networkidle
ストレージ・ネットワーク
agent-browser cookies
agent-browser storage local
agent-browser network requests
バッチ実行
複数コマンドをJSON形式で一括実行し、起動オーバーヘッドを削減できる。
基本フロー
open でページを開く
snapshot でアクセシビリティツリーとref IDを取得
find や ref IDで要素を特定
click, fill などで操作
wait で結果を待機
- 必要に応じて
screenshot や get で結果を確認