← 返回 Skills 市场
38
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install babata-browser
功能描述
巴巴塔浏览器控制技能 v2.0 — 基于 Playwright 的轻量浏览器自动化,自然语言控制,Accessibility Tree优先,零额外AI依赖
使用说明 (SKILL.md)
Babata Browser 🦞 v2.0
轻量浏览器自动化技能。给巴巴塔装一双"网页上的手"——打开网页、填写表单、点击按钮、提取数据、截图保存。
架构概览
信息获取优先级:
验证/事实查询 → API/CLI(最快,不走浏览器)
探索/开放搜索 → web_search(Tavily,多角度)
JS渲染/交互/截图 → babata-browser(兜底)
浏览器操作策略(v2.0 升级):
获取结构 + 可交互元素 → Accessibility Snapshot(首选,Token高效)
提取页面文字 → get_text(结构化)
获取页面视觉状态 → screenshot(兜底)
对比 browser-use
| browser-use | babata-browser v2.0 | |
|---|---|---|
| 依赖 | 50+包 | 仅 Playwright |
| 安装 | 300MB+/20min | 100MB/2min |
| 控浏览器 | ✅ | ✅ |
| AI决策 | 内置LLM | 巴巴塔LLM直接决策 |
| 页面交互策略 | 视觉模型驱动 | Accessibility Tree优先 |
| Token效率 | 低(截图+视觉AI) | 高(结构化数据) |
| 中文任务 | 一般 | ✅ 原生中文 |
核心设计原则
1. Accessibility Tree 优先
源自 Playwright MCP 设计模式。优先使用Playwright的Accessibility Tree快照获取页面结构和可交互元素,而不是视觉模型/截图。Token效率更高,且不需要额外AI视觉能力。
| 场景 | 首选方式 | 兜底 |
|---|---|---|
| 获取页面结构和可交互元素 | Accessibility Snapshot | — |
| 提取页面文字 | get_text / get_html |
— |
| 获取页面视觉状态 | — | screenshot |
2. CLI 轻量 > MCP 深度
微软Playwright团队已验证:CLI模式Token效率高于MCP。巴巴塔遵循同样原则:
- 高频操作(导航/点击/提取)→ 直接Playwright CLI API(轻量快速)
- 长周期/多步骤/需持久化状态 → MCP协议(富状态编排)
3. 巴巴塔LLM直接决策
不内嵌LLM,所有操作决策由巴巴塔的DeepSeek模型完成。优势:
- 统一上下文(不用切AI)
- 统一记忆(操作历史可追踪)
- 统一安全(Guardrails覆盖所有操作路径)
安装
前置依赖
pip install playwright
python -m playwright install chromium
安装本包(全局可导入)
# 从 babata-browser 目录执行
cd skills/babata-browser
pip install -e .
安装后可从任意目录 import,包括 cron 隔离会话。
使用
from scripts.babata_browser import execute_task
# 一句话操控浏览器
execute_task("打开卫健委官网,搜索最新政策,提取前5条标题")
execute_task("打开 https://example.com,搜索 医疗AI,提取结果")
execute_task("打开登录页,填表提交,截图保存")
CLI 模式
babata-browser '打开 GitHub Trending,提取热门项目' --json
内置能力
| 动作 | 说明 | 策略 |
|---|---|---|
goto |
导航到URL | CLI |
get_text |
提取页面文字(Accessibility Tree优先) | CLI |
get_html |
获取HTML | CLI |
click |
点击元素(文本/CSS) | CLI |
fill |
填写表单 | CLI |
get_links |
提取所有链接 | CLI |
screenshot |
全页截图(Accessibility Tree不可用时兜底) | CLI |
scroll |
滚动页面 | CLI |
execute_js |
执行JavaScript | CLI |
extract_table |
智能提取表格 | CLI |
search_and_extract |
搜索+提取 | CLI |
login_if_needed |
自动登录 | CLI/MCP双模式 |
accessibility_snapshot |
获取Accessibility Tree快照(v2.0新增) | CLI |
应用场景
- 卫健委/医保局/中纪委官网动态政策抓取
- 政府监管系统自动填报
- JS渲染页面数据采集
- 网页内容变化监控
- 自动化表单提交
变更日志
| 版本 | 日期 | 改动 |
|---|---|---|
| v2.0 | 2026-05-07 | 新增Accessibility Tree优先策略、CLI/MCP双模式选择、策略表。来源:Playwright MCP设计模式 |
| v1.0 | — | 初始版本 |
安全使用建议
Review carefully before installing. Use it only in an isolated environment, avoid production or government/account workflows unless you add confirmations, remove the default --no-sandbox behavior where possible, and do not enter passwords or sensitive form data unless outputs are redacted.
功能分析
Type: OpenClaw Skill
Name: babata-browser
Version: 2.0.0
The babata-browser skill is a legitimate lightweight wrapper for Playwright automation, designed to allow an AI agent to interact with web pages. It provides standard automation capabilities such as navigation, text/table extraction, form filling, and JavaScript execution within the browser context. While it includes high-risk functions like 'execute_js' and 'login_if_needed', these are standard for browser automation tools and show no evidence of malicious intent, data exfiltration, or host-level persistence. The code in scripts/babata_browser.py is transparent and aligns with the documentation in SKILL.md.
能力评估
Purpose & Capability
The browser-automation purpose matches the code, and there is no clear exfiltration or hidden endpoint. However, the declared capabilities include high-impact actions such as login, form filling/submission, arbitrary page JavaScript, and use on government reporting systems without clear built-in boundaries.
Instruction Scope
The instructions and examples encourage automated website interaction, including form submission, but do not describe confirmation checkpoints, domain allowlists, dry-run previews, or rollback guidance for sensitive actions.
Install Mechanism
The registry says there is no install spec, while SKILL.md instructs users to install Playwright, download Chromium, and install the package with pip. This is expected for a Playwright tool but should be done in a trusted, isolated Python environment.
Credentials
The included code launches Chromium with --no-sandbox by default while the tool is intended to open arbitrary webpages, which reduces browser containment.
Persistence & Privilege
No background persistence or local browser-profile reuse is shown, but the skill can handle website credentials and form values, and its generic fill helper returns entered values that may include secrets or personal data.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install babata-browser - 安装完成后,直接呼叫该 Skill 的名称或使用
/babata-browser触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v2.0.0
v2.0: Accessibility Tree优先策略, CLI/MCP双模式, pip install -e . 全局可导入, 修复cron隔离会话import失败问题
元数据
常见问题
Babata Browser 是什么?
巴巴塔浏览器控制技能 v2.0 — 基于 Playwright 的轻量浏览器自动化,自然语言控制,Accessibility Tree优先,零额外AI依赖. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 38 次。
如何安装 Babata Browser?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install babata-browser」即可一键安装,无需额外配置。
Babata Browser 是免费的吗?
是的,Babata Browser 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Babata Browser 支持哪些平台?
Babata Browser 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Babata Browser?
由 Meta-Evo(@meta-evo-creator)开发并维护,当前版本 v2.0.0。
推荐 Skills