{"name":"browser","url":"https://github.com/browserbase/skills/tree/main/skills/browser","install":"npx skills add browserbase/skills --skill browser","sdk":"browserbase","key":"browserbase/browser","description":"Automate web browser interactions using natural language via CLI commands. Use when the user asks to browse websites, navigate web pages, extract data from websites, take screenshots, fill forms, click buttons, or interact with web applications. Supports remote Browserbase sessions with Browserbase Identity, Verified browsers, automatic CAPTCHA solving, and residential proxies — ideal for protected websites and JavaScript-heavy pages.","hasContent":true,"content":"---\nname: browser\ndescription: Automate web browser interactions using natural language via CLI commands. Use when the user asks to browse websites, navigate web pages, extract data from websites, take screenshots, fill forms, click buttons, or interact with web applications. Supports remote Browserbase sessions with Browserbase Identity, Verified browsers, automatic CAPTCHA solving, and residential proxies — ideal for protected websites and JavaScript-heavy pages.\ncompatibility: \"Requires the browse CLI (`npm install -g browse`). Remote Browserbase sessions need `BROWSERBASE_API_KEY`. Local mode uses Chrome/Chromium on your machine.\"\nlicense: MIT\nallowed-tools: Bash\nmetadata:\n  openclaw:\n    requires:\n      bins:\n        - browse\n    install:\n      - kind: node\n        package: \"browse\"\n        bins: [browse]\n    homepage: https://github.com/browserbase/skills\n---\n\n# Browser Automation\n\nAutomate browser interactions using the browse CLI with Claude.\n\n## Setup check\n\nBefore running any browser commands, verify the CLI is available:\n\n```bash\nwhich browse || npm install -g browse\n```\n\n## Environment Selection (Local vs Remote)\n\nThe CLI supports explicit per-command environment flags. If you do nothing, the next session defaults to Browserbase when `BROWSERBASE_API_KEY` is set and to local otherwise.\n\n### Local mode\n- `browse open <url> --local` starts a clean isolated local browser\n- `browse open <url> --auto-connect` attaches to an already-running debuggable Chrome; use `--local` when no debuggable Chrome is available\n- `browse open <url> --cdp <port|url>` attaches to a specific CDP target\n- Best for: development, localhost, trusted sites, and reproducible runs\n\n### Remote mode (Browserbase)\n- `browse open <url> --remote` starts a Browserbase session\n- Without a local flag, Browserbase is also the default when `BROWSERBASE_API_KEY` is set\n- Provides: Browserbase Identity, Verified browsers, automatic CAPTCHA solving, residential proxies, session persistence\n- **Use remote mode when:** the target site has bot detection, CAPTCHAs, IP rate limiting, Cloudflare protection, or requires geo-specific access\n- Get credentials at https://browserbase.com/settings\n\n### When to choose which\n- **Repeatable local testing / clean state**: `browse open <url> --local`\n- **Reuse your local login/cookies**: `browse open <url> --auto-connect`\n- **Simple browsing** (docs, wikis, public APIs): local mode is fine\n- **Protected sites** (login walls, CAPTCHAs, anti-scraping): use remote mode\n- **If local mode fails** with bot detection or access denied: switch to remote mode\n\n## Commands\n\nMost driver commands work across local, remote, and CDP sessions after the daemon starts.\n\n### Navigation\n```bash\nbrowse open <url>                        # Go to URL\nbrowse open <url> --local                # Go to URL in a clean local browser\nbrowse open <url> --remote               # Go to URL in a Browserbase session\nbrowse reload                            # Reload current page\nbrowse back                              # Go back in history\nbrowse forward                           # Go forward in history\n```\n\n### Page state (prefer snapshot over screenshot)\n```bash\nbrowse snapshot                          # Get accessibility tree with element refs (fast, structured)\nbrowse screenshot --path <path>          # Take visual screenshot (slow, uses vision tokens)\nbrowse get url                           # Get current URL\nbrowse get title                         # Get page title\nbrowse get text <selector>               # Get text content (use \"body\" for all text)\nbrowse get html <selector>               # Get HTML content of element\nbrowse get markdown [selector]           # Get page content as markdown (defaults to body)\nbrowse get value <selector>              # Get form field value\n```\n\nUse `browse snapshot` as your default for understanding page state — it returns the accessibility tree with element refs you can use to interact. Only use `browse screenshot` when you need visual context (layout, images, debugging).\n\n### Interaction\n```bash\nbrowse click <ref>                       # Click element by ref from snapshot (e.g., @0-5)\nbrowse type <text>                       # Type text into focused element\nbrowse fill <selector> <value>           # Fill input; add --press-enter if Enter is needed\nbrowse select <selector> <values...>     # Select dropdown option(s)\nbrowse upload <selector> <files...>      # Upload file(s) to <input type=\"file\">\nbrowse press <key>                       # Press key (Enter, Tab, Escape, Cmd+A, etc.)\nbrowse mouse drag <fromX> <fromY> <toX> <toY>  # Drag from one point to another\nbrowse mouse scroll <x> <y> <deltaX> <deltaY>  # Scroll at coordinates\nbrowse highlight <selector>              # Highlight element on page\nbrowse is visible <selector>             # Check if element is visible\nbrowse is checked <selector>             # Check if element is checked\nbrowse wait <type> [arg]                 # Wait for: load, selector, timeout\n```\n\n### CDP event tailing\n```bash\nbrowse cdp <url|port>                    # Stream CDP events as NDJSON from any target\nbrowse cdp 9222                          # Attach to local Chrome on port 9222\nbrowse cdp ws://localhost:9222/devtools/browser/...  # Full WebSocket URL\nbrowse cdp <url> --domain Network        # Only Network events\nbrowse cdp <url> --domain Network --domain Console  # Multiple domains\nbrowse cdp <url> --pretty                # Human-readable output\nbrowse cdp <url> > events.jsonl          # Pipe to file\nbrowse cdp <url> | jq '.method'          # Filter with jq\n```\n\nThe `cdp` command connects directly to any Chrome DevTools Protocol target and streams events. It does **not** use the daemon — it's a standalone, long-running process. Press Ctrl+C to stop. Default domains: Network, Console, Runtime, Log, Page.\n\n### Session management\n```bash\nbrowse stop                              # Stop the browser daemon\nbrowse status                            # Check daemon status and resolved mode\nbrowse tab list                          # List all open tabs\nbrowse tab switch <index-or-target-id>   # Switch to tab by index or target ID\nbrowse tab close [index-or-target-id]    # Close tab\n```\n\n### Typical workflow\nIf the environment matters, put `--local`, `--remote`, `--auto-connect`, or `--cdp <port|url>` on the first browser command.\n\n1. `browse open <url> --local` or `browse open <url> --remote` — navigate to the page\n2. `browse snapshot` — read the accessibility tree to understand page structure and get element refs\n3. `browse click <ref>` / `browse type <text>` / `browse fill <selector> <value>` — interact using refs from snapshot\n4. `browse snapshot` — confirm the action worked\n5. Repeat 3-4 as needed\n6. `browse stop` — close the browser when done\n\n## Quick Example\n\n```bash\nbrowse open https://example.com\nbrowse snapshot                          # see page structure + element refs\nbrowse click @0-5                        # click element with ref 0-5\nbrowse get title\nbrowse stop\n```\n\n## Mode Comparison\n\n| Feature | Local | Browserbase |\n|---------|-------|-------------|\n| Speed | Faster | Slightly slower |\n| Setup | Chrome required | API key required |\n| Reuse existing local cookies | With `browse open <url> --auto-connect` | N/A |\n| Verified browser | No | Yes (Browserbase Verified browser via Identity) |\n| CAPTCHA solving | No | Yes (automatic reCAPTCHA/hCaptcha) |\n| Residential proxies | No | Yes (201 countries, geo-targeting) |\n| Session persistence | No | Yes (cookies/auth persist via contexts) |\n| Best for | Development/simple pages | Protected sites, Browserbase Identity + Verified access, production scraping |\n\n## Best Practices\n\n1. **Choose the local strategy deliberately**: use `browse open <url> --local` for clean state, `browse open <url> --auto-connect` for existing local credentials, and `browse open <url> --remote` for protected sites\n2. **Always `browse open` first** before interacting\n3. **Use `browse snapshot`** to check page state — it's fast and gives you element refs\n4. **Only screenshot when visual context is needed** (layout checks, images, debugging)\n5. **Use refs from snapshot** to click/interact — e.g., `browse click @0-5`\n6. **`browse stop`** when done to clean up the browser session and clear the env override\n\n## Troubleshooting\n\n- **\"No active page\"**: Run `browse stop`, then check `browse status`. If it still says running, kill the zombie daemon with `pkill -f \"browse.*daemon\"`, then retry `browse open`\n- **Chrome not found**: Install Chrome, use `browse open <url> --auto-connect` if you already have a debuggable Chrome running, or switch to `browse open <url> --remote`\n- **Action fails**: Run `browse snapshot` to see available elements and their refs\n- **Browserbase fails**: Verify API key is set\n\n## Switching to Remote Mode\n\nSwitch to remote when you detect: CAPTCHAs (reCAPTCHA, hCaptcha, Turnstile), bot detection pages (\"Checking your browser...\"), HTTP 403/429, empty pages on sites that should have content, or the user asks for it.\n\nDon't switch for simple sites (docs, wikis, public APIs, localhost).\n\n```bash\nbrowse open <url> --local          # clean isolated local browser\nbrowse open <url> --auto-connect   # attach to existing debuggable Chrome\nbrowse open <url> --remote         # Browserbase session\n```\n\nMode flags are applied when a session starts. After `browse stop`, the next start falls back to env-var-based auto detection. Use `browse status` to inspect the resolved mode and target while the daemon is running.\n\nFor detailed examples, see [EXAMPLES.md](EXAMPLES.md).\nFor API reference, see [REFERENCE.md](REFERENCE.md).\n","contentSource":"https://raw.githubusercontent.com/browserbase/skills/main/skills/browser/SKILL.md","contentFetchedAt":"2026-07-28T23:15:39.268Z"}