这是 OpenClaw browser 工具的封装,提供强大的浏览器自动化能力。
功能说明打开网页导航到指定 URL截图页面截图或全页截图快照获取页面 DOM 快照(AI 快照或 ARIA 快照)点击点击页面元素输入在输入框中输入文本滚动滚动页面等待等待元素/文本/URL 加载标签页管理打开/切换/关闭标签页文件上传上传文件到网页下载从网页下载文件
text
browser action=status
text
browser action=start
text
browser action=open url="https://example.com"
javascript
// 普通截图
browser action=screenshot
// 全页截图
browser action=screenshot fullPage=true
// 带标签的截图(显示元素编号)
browser action=snapshot labels=true
javascript
// AI 快照(带数字编号,适合点击操作)
browser action=snapshot
// 交互式快照(推荐,更稳定)
browser action=snapshot interactive=true
// 紧凑模式
browser action=snapshot compact=true
javascript
// 使用快照返回的数字 ref
browser action=act kind=click ref="12"
// 使用 role ref
browser action=act kind=click ref="e12"
javascript
// 输入文本并提交
browser action=act kind=type ref="23" text="hello" submit=true
// 输入后按回车
browser action=act kind=press key="Enter"
javascript
// 等待文本出现
browser action=wait text="完成"
// 等待 URL 变化
browser action=wait url="**/dashboard"
// 等待加载状态
browser action=wait load=networkidle
// 组合等待
browser action=wait selector="#main" url="**/dash" load=networkidle
javascript
// 打开新标签页
browser action=open url="https://example.com"
// 列出标签页
browser action=tabs
// 切换到指定标签页
browser action=focus targetId="abcd1234"
// 关闭标签页
browser action=close targetId="abcd1234"
javascript
// 上传文件
browser action=upload filePath="/tmp/openclaw/uploads/file.pdf"
javascript
// 滚动到元素可见
browser action=act kind=scrollIntoView ref="e12"
// 滚动到顶部/底部
browser action=act kind=evaluate fn="window.scrollTo(0, document.body.scrollHeight)"
javascript
// 设置离线模式
browser action=set offline=true
// 设置自定义 Headers
browser action=set headers="{\"X-Debug\":\"1\"}"
// 设置地理位置
browser action=set geo="37.7749,-122.4194"
// 设置 User Agent / 设备
browser action=set device="iPhone 14"
ref="12" 这样的数字--interactive 或 --compact 参数[ref=e12] 格式的角色引用highlight 可以高亮显示目标元素,验证点击位置browser action=open url="https://example.com/login"browser action=snapshot → 获取快照browser action=act kind=type ref="5" text="username" → 输入用户名browser action=act kind=type ref="6" text="password" → 输入密码browser action=act kind=click ref="7" → 点击登录按钮browser action=wait url="**/dashboard" → 等待跳转打开页面
browser action=snapshot interactive=true
使用 fill 批量填充多个字段:
javascript
browser action=act kind=fill fields='[{"ref":"1","type":"text","value":"张三"},{"ref":"2","type":"text","value":"25"}]'
browser action=waitfordownload filename="report.pdf"/tmp/openclaw/downloads/javascript
browser action=console level="error"
javascript
browser action=requests filter="api"
javascript
browser action=trace_start
// 执行操作
browser action=trace_stop
javascript
browser action=highlight ref="e12"
参数类型说明actionstring操作类型:status, start, stop, tabs, open, focus, close, snapshot, screenshot, act, navigate, wait, upload 等urlstring目标 URLprofilestring浏览器配置:openclaw (默认) / chrome (使用你的 Chrome)targetstring浏览器目标:sandbox / host / noderefstring元素引用编号textstring输入的文本fullPageboolean是否截取完整页面interactiveboolean是否使用交互式快照compactboolean是否使用紧凑模式kindstring操作类型:click, type, press, hover, scroll, select, drag, fill, evaluate