browser-use

📁 cklxx/elephant.ai 📅 Today
1
总安装量
1
周安装量
#76402
全站排名
安装命令
npx skills add https://github.com/cklxx/elephant.ai --skill browser-use

Agent 安装分布

amp 1
cline 1
opencode 1
cursor 1
continue 1
kimi-cli 1

Skill 文档

browser-use

通过 Playwright MCP Extension Relay 控制用户当前 Chrome 浏览器,复用已登录的 session。

前置条件

  1. Chrome 安装了 Playwright MCP Bridge 扩展
  2. .env 中配置了 ALEX_BROWSER_BRIDGE_TOKEN(从扩展弹窗复制)

调用

# 导航到 URL
python3 skills/browser-use/run.py '{"action":"navigate","url":"https://x.com"}'

# 获取页面快照(无障碍树)
python3 skills/browser-use/run.py '{"action":"snapshot"}'

# 点击元素(ref 来自 snapshot)
python3 skills/browser-use/run.py '{"action":"click","ref":"e44","element":"Home link"}'

# 输入文本
python3 skills/browser-use/run.py '{"action":"type","ref":"e100","text":"hello","submit":true}'

# 截图
python3 skills/browser-use/run.py '{"action":"screenshot","filename":"page.png"}'

# 管理标签页
python3 skills/browser-use/run.py '{"action":"tabs","tab_action":"list"}'

# 执行 JavaScript
python3 skills/browser-use/run.py '{"action":"evaluate","function":"() => document.title"}'

# 执行 Playwright 代码
python3 skills/browser-use/run.py '{"action":"run_code","code":"async (page) => await page.title()"}'

# 按键
python3 skills/browser-use/run.py '{"action":"press_key","key":"Enter"}'

# 等待文本出现
python3 skills/browser-use/run.py '{"action":"wait_for","text":"Loading complete"}'

典型工作流

  1. navigate → 打开目标页面
  2. snapshot → 获取页面结构和元素 ref
  3. click / type → 与页面交互
  4. snapshot → 确认结果