openclaw browser
提供无头浏览器操作能力,支持截图、网页导航和页面交互,供 Agent 工具链调用。
命令签名
bash
openclaw browser <子命令> [选项]子命令
| 子命令 | 说明 |
|---|---|
screenshot | 对指定 URL 截图 |
navigate | 导航到指定页面 |
interact | 与页面元素交互 |
pdf | 将页面导出为 PDF |
openclaw browser screenshot
对目标 URL 进行截图并保存。
bash
openclaw browser screenshot <url> [选项]| 选项 | 类型 | 说明 |
|---|---|---|
--output <path> | string | 输出文件路径(默认 screenshot.png) |
--width <px> | number | 视口宽度(默认 1280) |
--height <px> | number | 视口高度(默认 720) |
--full-page | boolean | 全页面截图 |
openclaw browser navigate
导航到指定 URL 并返回页面信息。
bash
openclaw browser navigate <url> [选项]| 选项 | 类型 | 说明 |
|---|---|---|
--wait <selector> | string | 等待指定选择器出现 |
--timeout <ms> | number | 超时时间(默认 30000) |
openclaw browser interact
执行页面交互操作(点击、输入、滚动等)。
bash
openclaw browser interact --action <action> [选项]| 选项 | 类型 | 说明 |
|---|---|---|
--action <action> | string | 操作类型:click、type、scroll |
--selector <sel> | string | CSS 选择器 |
--value <text> | string | 输入内容(用于 type) |
示例
bash
# 网页截图
openclaw browser screenshot https://example.com --output page.png
# 全页面截图
openclaw browser screenshot https://example.com --full-page
# 导航并等待元素
openclaw browser navigate https://example.com --wait "#content"
# 页面导出 PDF
openclaw browser pdf https://example.com --output page.pdfTIP
浏览器工具主要供 Agent 的 Web 工具链调用。手动使用时适合调试和验证页面状态。
另请参阅
openclaw agent— Agent 管理openclaw docs— 文档访问
