← 返回
未分类

Browser Hosting

OpenClaw browser hosting and automation capabilities for web interaction, scraping, and UI testing. Provides isolated browser profiles, snapshot-based automa...
OpenClaw 浏览器托管与自动化功能,用于网页交互、爬取和 UI 测试。提供隔离的浏览器配置文件、基于快照的自动化等。
frisky1985
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 196
下载
💾 0
安装
1
版本
#latest

概述

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, remote simultaneously
  • Remote CDP: Connect to browsers on other machines
  • Browserless integration: Use hosted Chromium services

Snapshot System

Two approaches for reliable UI interaction:

  1. AI Snapshots (--format ai): Numeric references like [1], [2]
    • Best for simple, one-off interactions
    • Uses Playwright's aria-ref internally
  1. 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), file upload
  • 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 --interactive snapshots for better reliability
  • Browser won't start: Check executablePath and permissions
  • Playwright errors: Install full Playwright package, not just core

Debugging Workflow

  1. snapshot --interactive to get current state
  2. highlight to verify target location
  3. errors --clear to check JavaScript errors
  4. requests --filter api --clear to monitor network
  5. trace start → reproduce issue → trace stop for deep debugging

Bundled Resources

Scripts

References

Assets

Best Practices

  1. Always use role snapshots (--interactive) for automation
  2. Snapshot before every action - references aren't stable across navigation
  3. Use wait conditions before snapshotting dynamic content
  4. Prefer isolated profiles over extension relay for automation
  5. Validate executable paths on new systems
  6. 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.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-26 23:54 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Update Docs

frisky1985
此技能应在用户请求“更新我的更改的文档”“检查此 PR 的文档”“哪些文档需要更新”“将文档与代码同步”等情况下使用。
★ 0 📥 210

Qoder Skill

frisky1985
阿里云Qoder集成—AI代码生成、重构、SPEC驱动开发,使用百炼coding plan套餐,适用于代码生成、重构、逆向文档生成及SPEC驱动开发场景。
★ 0 📥 210

Scrapling Install

frisky1985
Advanced web scraping with Scrapling — MCP-native guidance for extraction, crawling, and anti-bot handling. Use via mcpo
★ 0 📥 208