返回顶部
b

browser-use-local浏览器本地自动化

Use when you need browser automation via the browser-use CLI or Python code in this OpenClaw container/host: open pages, click/type, take screenshots, extract HTML/links, or run an Agent with an OpenAI-compatible LLM (e.g. Moonshot/Kimi) using a custom base_url. Also use for debugging browser-use sessions (state empty, page readiness timeouts), and for extracting login QR codes from demo/login pages via screenshots or HTML data:image.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
1,517
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

browser-use-local

技能名称: browser-use-local
详细描述:

browser-use (本地) 操作手册

本环境中的默认约束

  • - 在此环境中,优先使用 browser-use (CLI/Python) 而非 OpenClaw 的 browser 工具;如果不存在受支持的系统浏览器,OpenClaw 的 browser 可能会失败。
  • 使用 持久会话 执行多步骤流程:--session <名称>。

快速 CLI 工作流程 (非代理模式)

1) 打开

bash
browser-use --session demo open https://example.com

2) 检查 (有时在复杂/JS 网站上,state 返回 0 个元素)

bash
browser-use --session demo --json state | jq .data | {url,title,elements:(.elements|length)}

3) 截图 (始终有效;最佳调试原语)

bash
browser-use --session demo screenshot /home/node/.openclaw/workspace/page.png

4) 用于链接发现的 HTML (即使 state 为空也有效)

bash
browser-use --session demo --json get html > /tmp/page_html.json
python3 - < import json,re
html=json.load(open(/tmp/page_html.json)).get(data,{}).get(html,)
urls=set(re.findall(rhttps?://[^\s\<>]+, html))
for u in sorted([u for u in urls if any(k in u for k in [demo,login,console,qr,qrcode])])[:200]:
print(u)
PY

5) 通过 JS 进行轻量级 DOM 查询 (当 state 为空时有用)

bash
browser-use --session demo --json eval location.href
browser-use --session demo --json eval document.title

使用兼容 OpenAI 的 LLM (Moonshot/Kimi) 的代理工作流程

当 CLI 的 run 路径需要 Browser-Use 云密钥,或者需要严格控制 LLM 参数时,使用 Python 进行代理运行。

最小化可用的 Kimi 示例

创建 .env (或导出环境变量),包含:

  • - OPENAIAPIKEY=...
  • OPENAIBASEURL=https://api.moonshot.cn/v1

然后运行捆绑脚本:

bash
source /home/node/.openclaw/workspace/.venv-browser-use/bin/activate
python /home/node/.openclaw/workspace/skills/browser-use-local/scripts/runagentkimi.py

实践中观察到的 Kimi/Moonshot 特性 (修复方法):

  • - kimi-k2.5 的 temperature 必须为 1。
  • kimi-k2.5 的 frequency_penalty 必须为 0。
  • Moonshot 可能会拒绝用于结构化输出的严格 JSON Schema。启用:
- removedefaultsfrom_schema=True - removeminitemsfromschema=True

如果遇到提及 responseformat.jsonschema ... keyword default is not allowed 或 min_items unsupported 的 400 错误,首先设置这两个标志。

二维码提取 (登录/演示页面)

首选顺序

1) 对页面截图 并裁剪候选区域 (快速、稳健)。
2) 如果 HTML 包含 data:image/png;base64,...,提取并解码。

裁剪候选区域

使用 scripts/crop_candidates.py 从截图中生成多个可能的二维码裁剪区域。

bash
source /home/node/.openclaw/workspace/.venv-browser-use/bin/activate
python skills/browser-use-local/scripts/crop_candidates.py \
--in /home/node/.openclaw/workspace/login.png \
--outdir /home/node/.openclaw/workspace/qr_crops

从 HTML 中提取 Base64 嵌入的图像

bash
source /home/node/.openclaw/workspace/.venv-browser-use/bin/activate
browser-use --session demo --json get html > /tmp/page_html.json
python skills/browser-use-local/scripts/extractdataimages.py \
--in /tmp/page_html.json \
--outdir /home/node/.openclaw/workspace/data_imgs

故障排除

  • - state 显示 elements: 0:使用 get html + 正则表达式发现,以及截图;使用 eval 查询 DOM。
  • 页面就绪超时警告:通常无害;依赖截图 + HTML。
  • CLI 标志顺序:全局标志放在子命令 之前
- ✅ browser-use --browser chromium --json open https://... - ❌ browser-use open https://... --browser chromium

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 browser-use-local-1776360877 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 browser-use-local-1776360877 技能

通过命令行安装

skillhub install browser-use-local-1776360877

下载

⬇ 下载 browser-use-local v1.0.0(免费)

文件大小: 4.66 KB | 发布时间: 2026-4-17 14:24

v1.0.0 最新 2026-4-17 14:24
- Initial release of browser-use-local skill for browser automation in OpenClaw containers/hosts.
- Provides CLI and Python instructions for opening pages, clicking/typing, screenshots, HTML/link extraction, and QR code retrieval.
- Documents persistent session usage and troubleshooting for JS-heavy sites (state empty, page readiness).
- Details workflow for running Agents with OpenAI-compatible LLMs (Moonshot/Kimi), including known parameter quirks and fixes.
- Includes example scripts for QR code extraction from screenshots and HTML-embedded images.
- Clarifies CLI flag order and recommends when to use browser-use over OpenClaw browser tool.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部