Browser Hosting Skill
This skill provides comprehensive browser automation capabilities through OpenClaw's managed browser system. It enables safe, isolated web interaction with deterministic UI control.
When to Use This Skill
- Web scraping - Extract structured data from websites
- UI automation - Automate form filling, clicks, navigation
- Web testing - Verify page behavior and functionality
- Content extraction - Get text, screenshots, or PDFs from web pages
- Browser isolation - Perform web operations without affecting personal browsing
- Remote browser control - Control browsers on other machines via nodes
Quick Start
Basic Workflow
# 1. Open a page
openclaw browser --browser-profile openclaw open https://example.com
# 2. Take a snapshot to see interactive elements
openclaw browser --browser-profile openclaw snapshot --interactive
# 3. Perform actions using references from snapshot
openclaw browser --browser-profile openclaw click e12
openclaw browser --browser-profile openclaw type i23 "search term" --submit
Profile Selection
openclaw: Isolated managed browser (recommended for automation)chrome: Chrome extension relay (for controlling existing Chrome tabs)
Core Capabilities
Browser Profiles
- Isolated instances: Each profile has separate user data directory
- Multiple profiles: Run
openclaw,work,remotesimultaneously - Remote CDP: Connect to browsers on other machines
- Browserless integration: Use hosted Chromium services
Snapshot System
Two approaches for reliable UI interaction:
-
AI Snapshots (
--format ai): Numeric references like[1],[2]- Best for simple, one-off interactions
- Uses Playwright's aria-ref internally
-
Role Snapshots (
--interactive): Semantic references like[ref=e12]- Recommended for automation - more stable and descriptive
- Role-based naming:
e=button,b=link,i=input,s=select - Supports iframe scoping with
--frame
Automation Actions
- Navigation:
open,navigate,close - Interaction:
click,type,press,hover,drag,select - Input:
fill(structured form data), fileupload - Waiting: Intelligent waits for elements, URLs, network idle, JS conditions
- Debugging:
highlight,trace,errors,requests
Content Extraction
- Text: Structured snapshots with references
- Screenshots: Full page or element-specific
- PDF: Generate PDFs from web pages
- Network: Monitor API calls and responses
Configuration
Browser settings are managed in ~/.openclaw/openclaw.json. Key options:
{
"browser": {
"enabled": true,
"defaultProfile": "openclaw",
"profiles": {
"openclaw": { "cdpPort": 18800 },
"work": { "cdpPort": 18801 },
"remote": { "cdpUrl": "http://10.0.0.42:9222" }
}
}
}
See configuration.md for complete configuration guide.
Usage Patterns
Simple Web Scraping
# Get page content
openclaw browser --browser-profile openclaw open https://news-site.com
openclaw browser --browser-profile openclaw snapshot --interactive --compact
Form Automation
# Fill out a form
openclaw browser --browser-profile openclaw open https://form-site.com
openclaw browser --browser-profile openclaw snapshot --interactive
openclaw browser --browser-profile openclaw type i1 "John Doe"
openclaw browser --browser-profile openclaw type i2 "john@example.com"
openclaw browser --browser-profile openclaw click e5 # Submit button
Multi-step Workflows
# Navigate through multiple pages
openclaw browser --browser-profile openclaw open https://shop.com
openclaw browser --browser-profile openclaw wait --load networkidle
openclaw browser --browser-profile openclaw snapshot --interactive
openclaw browser --browser-profile openclaw click b12 # Product link
openclaw browser --browser-profile openclaw wait --load networkidle
openclaw browser --browser-profile openclaw click e8 # Add to cart
Advanced Features
Remote Browser Control
Connect to browsers on other machines:
"profiles": {
"remote-workstation": {
"cdpUrl": "http://192.168.1.100:9222",
"color": "#00AA00"
}
}
Browserless Integration
Use hosted Chromium:
"profiles": {
"browserless": {
"cdpUrl": "https://production-sfo.browserless.io?token=YOUR_TOKEN",
"color": "#00AA00"
}
}
Node Proxy
Automatic routing to nodes with browser capability:
- No extra config needed if node has browser
- Gateway automatically proxies browser commands
- Use
target="node"to force specific node
Security & Isolation
- Complete isolation: Managed browsers never access personal profiles
- Loopback only: Browser control restricted to localhost
- Authentication required: All access requires Gateway auth
- No persistent sessions: Clean state between runs (unless configured otherwise)
- JavaScript execution: Can be disabled via
browser.evaluateEnabled=false
Troubleshooting
Common Issues
- References not working: Always snapshot after navigation - refs change
- Element not found: Use
--interactivesnapshots for better reliability - Browser won't start: Check
executablePathand permissions - Playwright errors: Install full Playwright package, not just core
Debugging Workflow
snapshot --interactiveto get current statehighlight <ref>to verify target locationerrors --clearto check JavaScript errorsrequests --filter api --clearto monitor networktrace start→ reproduce issue →trace stopfor deep debugging
Bundled Resources
Scripts
browser_status.py: Check browser statusbrowser_snapshot.py: Take snapshots with optionsbrowser_action.py: Perform UI actions
References
profiles.md: Profile management guidesnapshot-system.md: Complete snapshot referenceconfiguration.md: Full configuration guide
Assets
example-workflow.md: Complete workflow examples
Best Practices
- Always use role snapshots (
--interactive) for automation - Snapshot before every action - references aren't stable across navigation
- Use wait conditions before snapshotting dynamic content
- Prefer isolated profiles over extension relay for automation
- Validate executable paths on new systems
- Use environment variables for sensitive configuration (tokens, passwords)
This skill transforms OpenClaw into a powerful web automation platform while maintaining security and reliability through its snapshot-based, reference-driven approach.
Scan to join WeChat group