Browser Automation & Scraping
Browser (openclaw-managed)
Section titled “Browser (openclaw-managed)”OpenClaw allows your agent to control a dedicated Chrome/Brave/Edge/Chromium profile. This provides a safe, isolated environment for browser automation and web scraping, distinct from your personal browsing session.
Why use the Managed Browser?
Section titled “Why use the Managed Browser?”- Isolation: Keeps agent activity separate from your personal work.
- Safety: Prevents the agent from accidentally closing your tabs or leaking your session data.
- Capabilities: Enables full automation (snapshots, PDF generation, screenshots, complex interactions).
- Multi-Profile: Support for multiple isolated profiles (e.g.,
work,research,testing).
Quick Start
Section titled “Quick Start”Check Status Verify if the browser service is ready.
Terminal window openclaw browser --browser-profile openclaw statusStart the Browser Launch the managed browser instance.
Terminal window openclaw browser --browser-profile openclaw startOpen a Page Direct the agent to a URL.
Terminal window openclaw browser --browser-profile openclaw open https://example.comTake a Snapshot See what the agent sees.
Terminal window openclaw browser --browser-profile openclaw snapshot
Profiles: openclaw vs chrome
Section titled “Profiles: openclaw vs chrome”| Profile | Description | Use Case |
|---|---|---|
openclaw | Managed, isolated browser instance. | Recommended. Best for automation, scraping, and testing. |
chrome | Extension relay to your system browser. | Use when the agent needs access to your logged-in sessions (requires Chrome Extension). |
To use the managed browser by default, set browser.defaultProfile: "openclaw" in your config.
Configuration
Section titled “Configuration”Browser settings are located in ~/.openclaw/openclaw.json.
{ browser: { enabled: true, // Master switch // cdpUrl: "http://127.0.0.1:18792", // Legacy override remoteCdpTimeoutMs: 1500, // Timeout for remote CDP checks remoteCdpHandshakeTimeoutMs: 3000, defaultProfile: "chrome", // Change to "openclaw" for isolation color: "#FF4500", // UI tint color headless: false, // Set true for background operation noSandbox: false, attachOnly: false, // "true" = never launch, only attach executablePath: "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser", profiles: { openclaw: { cdpPort: 18800, color: "#FF4500" }, work: { cdpPort: 18801, color: "#0066CC" }, remote: { cdpUrl: "http://10.0.0.42:9222", color: "#00AA00" } } }}Browser Selection & Overrides
Section titled “Browser Selection & Overrides”If your system default browser is Chromium-based, OpenClaw uses it automatically. You can force a specific browser executable if needed.
openclaw config set browser.executablePath "/usr/bin/google-chrome"{ browser: { executablePath: "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser" }}{ browser: { executablePath: "C:\\Program Files\\BraveSoftware\\Brave-Browser\\Application\\brave.exe" }}{ browser: { executablePath: "/usr/bin/brave-browser" }}Local vs Remote Control
Section titled “Local vs Remote Control”OpenClaw supports flexible deployment models:
- Local Control (Default): Gateway runs locally, launches browser locally.
- Remote Control (Node Host): Gateway runs elsewhere, but uses a “Node Host” on your machine to control the browser.
- Remote CDP: Gateway connects directly to a remote debugger (e.g., a browser in a Docker container or another server).
Remote CDP with Auth
Section titled “Remote CDP with Auth”You can connect to a remote browser instance using a CDP URL.
- Query Token:
https://provider.example?token=<token> - Basic Auth:
https://user:pass@provider.example
Browserless (Hosted Remote CDP)
Section titled “Browserless (Hosted Remote CDP)”Browserless provides a hosted Chromium service, perfect for serverless deployments or when you don’t want to manage local browser resources.
{ browser: { enabled: true, defaultProfile: "browserless", profiles: { browserless: { cdpUrl: "https://production-sfo.browserless.io?token=<BROWSERLESS_API_KEY>", color: "#00AA00" } } }}Chrome Extension Relay
Section titled “Chrome Extension Relay”Drive your existing Chrome tabs (with your login sessions) using the Chrome Extension.
Install Extension Load the extension in “Developer Mode”.
Terminal window openclaw browser extension installNavigate to
chrome://extensions, enable Developer Mode, and “Load Unpacked” from the path provided.Attach to Tab Click the OpenClaw icon on the tab you want to control. The badge will show
ON.Control via Agent The agent can now use the
chromeprofile to interact with that tab.Terminal window openclaw browser --browser-profile chrome tabs
For a full guide, see Chrome Extension.
Troubleshooting & Debugging
Section titled “Troubleshooting & Debugging”Common issues and how to solve them.
- Take a Snapshot:
openclaw browser snapshot --interactiveto see what the agent sees. - Check Console:
openclaw browser console --level errorfor page errors. - Highlight:
openclaw browser highlight <ref>to verify element targeting. - Trace:
openclaw browser trace start/stopto record a Playwright trace for deep analysis.
- “Browser disabled”: Check
browser.enabled: truein config. - “Playwright not available”: Install full Playwright package or reinstall OpenClaw with browser support.
- “Not visible”: The element might be behind another element or not yet rendered. Use
waitcommands.
CLI Reference
Section titled “CLI Reference”See Browser CLI Reference for a complete list of commands.