返回顶部
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,491
下载量
0
收藏
概述
安装方式
版本历史

browser-use-local

# browser-use (local) playbook ## Default constraints in this environment - Prefer **browser-use** (CLI/Python) over OpenClaw `browser` tool here; OpenClaw `browser` may fail if no supported system browser is present. - Use **persistent sessions** to do multi-step flows: `--session <name>`. ## Quick CLI workflow (non-agent) 1) Open ```bash browser-use --session demo open https://example.com ``` 2) Inspect (sometimes `state` returns 0 elements on heavy/JS sites) ```bash browser-use --session demo --json state | jq '.data | {url,title,elements:(.elements|length)}' ``` 3) Screenshot (always works; best debugging primitive) ```bash browser-use --session demo screenshot /home/node/.openclaw/workspace/page.png ``` 4) HTML for link discovery (works even when `state` is empty) ```bash browser-use --session demo --json get html > /tmp/page_html.json python3 - <<'PY' import json,re html=json.load(open('/tmp/page_html.json')).get('data',{}).get('html','') urls=set(re.findall(r"https?://[^\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) Lightweight DOM queries via JS (useful when `state` is empty) ```bash browser-use --session demo --json eval "location.href" browser-use --session demo --json eval "document.title" ``` ## Agent workflow with OpenAI-compatible LLM (Moonshot/Kimi) Use Python for Agent runs when the CLI `run` path requires Browser-Use cloud keys or when you need strict control over LLM parameters. ### Minimal working Kimi example Create `.env` (or export env vars) with: - `OPENAI_API_KEY=...` - `OPENAI_BASE_URL=https://api.moonshot.cn/v1` Then run the bundled script: ```bash source /home/node/.openclaw/workspace/.venv-browser-use/bin/activate python /home/node/.openclaw/workspace/skills/browser-use-local/scripts/run_agent_kimi.py ``` **Kimi/Moonshot quirks observed in practice** (fixes): - `temperature` must be `1` for `kimi-k2.5`. - `frequency_penalty` must be `0` for `kimi-k2.5`. - Moonshot can reject strict JSON Schema used for structured output. Enable: - `remove_defaults_from_schema=True` - `remove_min_items_from_schema=True` If you get a 400 error mentioning `response_format.json_schema ... keyword 'default' is not allowed` or `min_items unsupported`, those two flags are the first thing to set. ## QR code extraction (login/demo pages) ### Preferred order 1) **Screenshot the page** and crop candidate regions (fast, robust). 2) If HTML contains `data:image/png;base64,...`, extract and decode it. ### Crop candidates Use `scripts/crop_candidates.py` to generate multiple likely QR crops from a screenshot. ```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 ``` ### Extract base64-embedded images from HTML ```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/extract_data_images.py \ --in /tmp/page_html.json \ --outdir /home/node/.openclaw/workspace/data_imgs ``` ## Troubleshooting - **`state` shows `elements: 0`**: use `get html` + regex discovery, plus screenshots; use `eval` to query DOM. - **Page readiness timeout warnings**: usually harmless; rely on screenshot + HTML. - **CLI flags order**: global flags go *before* the subcommand: - ✅ `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

下载 Zip 包

⬇ 下载 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
返回顶部