| name | browser-navigation |
| version | 1.0.0 |
| description | Automate browser interactions for web testing, form filling, screenshots, and data extraction.
Use when the user needs to:
- Navigate websites and interact with web pages
- Fill forms and click buttons
- Take screenshots of web content
- Test web applications
- Extract information from web pages
- Debug frontend issues in the browser
- Monitor console logs and network requests
- Record browser sessions as video
This skill uses agent-browser for comprehensive browser automation.
RECOMMENDATION: Disable Chrome DevTools or Playwright MCP when using this skill to save context.
|
Browser Automation with agent-browser
Comprehensive browser automation for testing, data extraction, and web interaction.
Quick Start
agent-browser open <url>
agent-browser snapshot -i
agent-browser click @e1
agent-browser fill @e2 "text"
agent-browser close
Core Workflow
- Navigate:
agent-browser open <url>
- Snapshot:
agent-browser snapshot -i (returns elements with refs like @e1, @e2)
- Interact using refs from the snapshot
- Re-snapshot after navigation or significant DOM changes
Installation
npm install -g agent-browser
npx agent-browser open https://example.com
Commands Reference
Navigation
agent-browser open <url>
agent-browser back
agent-browser forward
agent-browser reload
agent-browser close
Page Analysis (Snapshot)
agent-browser snapshot
agent-browser snapshot -i
agent-browser snapshot -c
agent-browser snapshot -d 3
agent-browser snapshot -s "#main"
Interactions (Use @refs from Snapshot)
agent-browser click @e1
agent-browser dblclick @e1
agent-browser hover @e1
agent-browser focus @e1
agent-browser fill @e2 "text"
agent-browser type @e2 "text"
agent-browser press Enter
agent-browser press Control+a
agent-browser keydown Shift
agent-browser keyup Shift
agent-browser check @e1
agent-browser uncheck @e1
agent-browser select @e1 "value"
agent-browser scroll down 500
agent-browser scrollintoview @e1
agent-browser drag @e1 @e2
agent-browser upload @e1 file.pdf
Getting Information
agent-browser get text @e1
agent-browser get html @e1
agent-browser get value @e1
agent-browser get attr @e1 href
agent-browser get title
agent-browser get url
agent-browser get count ".item"
agent-browser get box @e1
Checking State
agent-browser is visible @e1
agent-browser is enabled @e1
agent-browser is checked @e1
Screenshots & PDF
agent-browser screenshot
agent-browser screenshot path.png
agent-browser screenshot --full
agent-browser pdf output.pdf
Video Recording
agent-browser record start ./demo.webm
agent-browser click @e1
agent-browser record stop
agent-browser record restart ./take2.webm
Waiting
agent-browser wait @e1
agent-browser wait 2000
agent-browser wait --text "Success"
agent-browser wait --url "**/dashboard"
agent-browser wait --load networkidle
agent-browser wait --fn "window.ready"
Cookies & Storage
agent-browser cookies
agent-browser cookies set name value
agent-browser cookies clear
agent-browser storage local
agent-browser storage local key
agent-browser storage local set k v
agent-browser storage local clear
Network
agent-browser network route <url>
agent-browser network route <url> --abort
agent-browser network route <url> --body '{}'
agent-browser network unroute [url]
agent-browser network requests
agent-browser network requests --filter api
Browser Settings
agent-browser set viewport 1920 1080
agent-browser set device "iPhone 14"
agent-browser set geo 37.7749 -122.4194
agent-browser set offline on
agent-browser set headers '{"X-Key":"v"}'
agent-browser set credentials user pass
agent-browser set media dark
Tabs & Windows
agent-browser tab
agent-browser tab new [url]
agent-browser tab 2
agent-browser tab close
agent-browser window new
Frames
agent-browser frame "#iframe"
agent-browser frame main
Dialogs
agent-browser dialog accept [text]
agent-browser dialog dismiss
JavaScript Execution
agent-browser eval "document.title"
Example Workflows
Form Submission
agent-browser open https://example.com/form
agent-browser snapshot -i
agent-browser fill @e1 "user@example.com"
agent-browser fill @e2 "password123"
agent-browser click @e3
agent-browser wait --load networkidle
agent-browser snapshot -i
Authentication with Saved State
agent-browser open https://app.example.com/login
agent-browser snapshot -i
agent-browser fill @e1 "username"
agent-browser fill @e2 "password"
agent-browser click @e3
agent-browser wait --url "**/dashboard"
agent-browser state save auth.json
agent-browser state load auth.json
agent-browser open https://app.example.com/dashboard
Scraping Data
agent-browser open https://example.com/products
agent-browser snapshot -i --json > page_structure.json
agent-browser get text @e5
agent-browser get attr @e6 href
Taking Full Page Screenshot
agent-browser open https://example.com
agent-browser wait --load networkidle
agent-browser screenshot --full fullpage.png
Testing Login Flow
agent-browser open https://app.example.com/login
agent-browser snapshot -i
agent-browser fill @e1 "test@example.com"
agent-browser fill @e2 "testpassword"
agent-browser click @e3
agent-browser wait --url "**/dashboard"
agent-browser get text @e10
Debugging
agent-browser open example.com --headed
agent-browser console
agent-browser console --clear
agent-browser errors
agent-browser errors --clear
agent-browser highlight @e1
agent-browser trace start
agent-browser trace stop trace.zip
agent-browser --cdp 9222 snapshot
Sessions (Parallel Browsers)
agent-browser --session test1 open site-a.com
agent-browser --session test2 open site-b.com
agent-browser session list
JSON Output
Add --json for machine-readable output:
agent-browser snapshot -i --json
agent-browser get text @e1 --json
Semantic Locators (Alternative to Refs)
agent-browser find role button click --name "Submit"
agent-browser find text "Sign In" click
agent-browser find label "Email" fill "user@test.com"
agent-browser find first ".item" click
agent-browser find nth 2 "a" text
Best Practices
- Always snapshot first: Get the current page state before interacting
- Use interactive mode (-i): Shows only clickable/fillable elements
- Wait appropriately: Use
--load networkidle after navigation
- Re-snapshot after changes: DOM updates invalidate refs
- Save authentication state: Avoid repeated logins
- Use --headed for debugging: See what the browser sees
- Check console for errors:
agent-browser console reveals issues
When to Use This Skill
- Testing web applications end-to-end
- Automating repetitive web tasks
- Scraping data from websites
- Debugging frontend issues
- Taking screenshots for documentation
- Recording demo videos
- Verifying UI functionality
- Filling out forms programmatically
Disable conflicting MCPs
If Chrome DevTools or Playwright MCP is enabled, ask the user if they want to disable it to save context. This skill covers the same functionality.
Ask them to run:
/mcp
If they see chrome-devtools or playwright listed, suggest they remove it:
/mcp remove chrome-devtools
/mcp remove playwright
Don't run these commands yourself. Let the user decide whether to disable the MCP.