🌐 Claw Browser Skill
This skill gives the agent "Eyes" to browse the web using a real
Chromium browser.
Unlike simple HTTP requests, claw-browser:
- - Renders JavaScript
- Handles dynamic content
- Loads SPA applications
- Takes real screenshots
- Can run in visible (non-headless) mode
🛠️ Installation & Setup (READ FIRST)
⚠️ Before using this tool, the agent MUST set up the Python
environment and download browser binaries.
If venv does not exist, run this setup command block automatically:
`` bash
# 1. Create virtual environment
python3 -m venv venv
# 2. Activate it
source venv/bin/activate
# 3. Install dependencies
pip install -r requirements.txt
# 4. Download Chromium binaries (CRITICAL STEP)
playwright install chromium
CODEBLOCK0 bash
source venv/bin/activate && python browser.py --url "https://github.com/trending" --action read
CODEBLOCK1 bash
source venv/bin/activate && python browser.py --url "https://news.ycombinator.com" --action screenshot
CODEBLOCK2 bash
source venv/bin/activate && python browser.py --url "https://google.com" --action read --visible
CODEBLOCK3 bash
export DISPLAY=:0 && source venv/bin/activate && python browser.py --url "[https://google.com](https://google.com)" --action read --visible
`
This sets the DISPLAY variable so the browser can open on your screen.
------------------------------------------------------------------------
# 🧠 When Should the Agent Use This Skill?
Use claw-browser when:
- The page requires JavaScript rendering
- The site is dynamic (React, Vue, Angular, etc.)
- Screenshots are required
- The user explicitly asks to "open" or "see" a website
- Traditional HTTP requests fail
------------------------------------------------------------------------
# ⚡ Summary
claw-browser` transforms your OpenClaw agent from a simple API caller
into a real browser-powered assistant with visual capabilities.
It enables:
- - Dynamic page interaction
- Visual verification
- Demo-ready browsing
- Real-world automation
Made with ❤️ by @canbirlik
🌐 Claw 浏览器技能
该技能赋予智能体 眼睛,使其能够使用真实的 Chromium 浏览器浏览网页。
与简单的 HTTP 请求不同,claw-browser:
- - 渲染 JavaScript
- 处理动态内容
- 加载 SPA 应用
- 拍摄真实截图
- 可在可见(非无头)模式下运行
🛠️ 安装与设置(请先阅读)
⚠️ 使用此工具前,智能体必须设置 Python 环境并下载浏览器二进制文件。
如果 venv 不存在,请自动运行以下设置命令块:
bash
1. 创建虚拟环境
python3 -m venv venv
2. 激活虚拟环境
source venv/bin/activate
3. 安装依赖
pip install -r requirements.txt
4. 下载 Chromium 二进制文件(关键步骤)
playwright install chromium
⚠️ playwright install chromium 步骤至关重要。\
缺少此步骤,浏览器将无法启动。
🔧 工具与用法
browser.py
参数
参数 描述
----------------------------------- -----------------------------------
--url 要访问的网站(
必填)
--action 执行的操作:read 或 screenshot
--visible (可选)以可见模式运行浏览器(非无头模式)。当用户希望看到浏览器时使用。
🚀 执行示例
⚠️ 请始终先激活虚拟环境。
1️⃣ 读取页面(无头模式 - 默认)
bash
source venv/bin/activate && python browser.py --url https://github.com/trending --action read
2️⃣ 截取新闻网站截图
bash
source venv/bin/activate && python browser.py --url https://news.ycombinator.com --action screenshot
这将保存:
evidence.png
3️⃣ 可见模式(显示浏览器界面 - 适合演示)
bash
source venv/bin/activate && python browser.py --url https://google.com --action read --visible
这将在屏幕上启动一个真实的 Chromium 窗口。
4️⃣ 可见模式(WSL / Linux 修复)⭐️
如果遇到 Missing X server 或 Display not found 错误,请使用此命令:
bash
export DISPLAY=:0 && source venv/bin/activate && python browser.py --url https://google.com --action read --visible
这将设置 DISPLAY 变量,使浏览器能够在您的屏幕上打开。
🧠 智能体何时应使用此技能?
在以下情况下使用 claw-browser:
- - 页面需要 JavaScript 渲染
- 网站是动态的(React、Vue、Angular 等)
- 需要截图
- 用户明确要求打开或查看网站
- 传统 HTTP 请求失败
⚡ 总结
claw-browser 将您的 OpenClaw 智能体从简单的 API 调用器转变为具备视觉能力的真实浏览器驱动助手。
它支持:
- - 动态页面交互
- 视觉验证
- 可演示的浏览体验
- 真实世界的自动化
由 @canbirlik 用 ❤️ 制作