
使用方式
关于
管理和操作 BrowserWing——一个智能浏览器自动化平台。安装依赖、配置 LLM、创建和管理自动化任务,以及监控执行状态。
BrowserWing 管理技能
概述
BrowserWing是一个智能浏览器自动化平台,允许你:
- 录制、创建和回放浏览器自动化脚本
- 使用AI自主探索网站并生成可回放的脚本
- 通过HTTP API或MCP协议执行脚本
- 管理AI功能的LLM配置
API基础URL: http://localhost:8080/api/v1
认证: 使用 X-BrowserWing-Key: <api-key> 头部或 Authorization: Bearer <token>
1. 安装Google Chrome(前置条件)
BrowserWing需要在主机上安装Google Chrome。
Linux (Debian/Ubuntu)
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.list
sudo apt-get update
sudo apt-get install -y google-chrome-stable
macOS
brew install --cask google-chrome
Windows
从以下地址下载安装:https://www.google.com/chrome/
使用远程Chrome(替代方案)
如果Chrome在远程机器上运行并启用了调试:
google-chrome --remote-debugging-port=9222 --remote-debugging-address=0.0.0.0 --no-sandbox
2. LLM配置
AI功能(AI探索器、Agent聊天、智能提取)需要LLM配置。
列出LLM配置
curl -X GET 'http://localhost:8080/api/v1/llm-configs'
添加LLM配置
curl -X POST 'http://localhost:8080/api/v1/llm-configs' \
-H 'Content-Type: application/json' \
-d '{
"name": "my-openai",
"provider": "openai",
"api_key": "sk-xxx",
"model": "gpt-4o",
"base_url": "https://api.openai.com/v1",
"is_active": true,
"is_default": true
}'
支持的提供商: openai、anthropic、deepseek,或任何OpenAI兼容端点。
测试LLM配置
curl -X POST 'http://localhost:8080/api/v1/llm-configs/test' \
-H 'Content-Type: application/json' \
-d '{"name": "my-openai"}'
3. AI自主探索(自动生成脚本)
使用AI浏览网站、执行任务并自动生成可回放的脚本。
开始探索
curl -X POST 'http://localhost:8080/api/v1/ai-explore/start' \
-H 'Content-Type: application/json' \
-d '{
"task_desc": "Go to bilibili.com, search for AI, and get the first page of video results",
"start_url": "https://www.bilibili.com",
"llm_config_id": "my-openai"
}'
响应: 返回用于跟踪的会话 id。
流式探索事件(SSE)
curl -N 'http://localhost:8080/api/v1/ai-explore/<session-id>/stream'
返回实时Server-Sent Events:thinking、tool_call、progress、error、script_ready、done。
停止探索
curl -X POST 'http://localhost:8080/api/v1/ai-explore/<session-id>/stop'
获取生成的脚本
curl -X GET 'http://localhost:8080/api/v1/ai-explore/<session-id>/script'
保存生成的脚本
curl -X POST 'http://localhost:8080/api/v1/ai-explore/<session-id>/save'
4. 脚本管理
列出所有脚本
curl -X GET 'http://localhost:8080/api/v1/scripts'
获取脚本详情
curl -X GET 'http://localhost:8080/api/v1/scripts/<script-id>'
获取脚本概要
curl -X GET 'http://localhost:8080/api/v1/scripts/summary'
创建新脚本
curl -X POST 'http://localhost:8080/api/v1/scripts' \
-H 'Content-Type: application/json' \
-d '{
"name": "Search Bilibili",
"description": "Search for a keyword on Bilibili",
"url": "https://www.bilibili.com",
"actions": [
{"type": "navigate", "url": "https://www.bilibili.com"},
{"type": "click", "identifier": ".nav-search-input"},
{"type": "type", "identifier": ".nav-search-input", "value": "${keyword}"},
{"type": "press_key", "key": "Enter"},
{"type": "wait", "timeout": 3}
]
}'
变量: 使用 ${variable_name} 语法定义运行时参数。
兼容工具
Claude CodeCursor
标签
通用
