agentsclimarketplace

Browser harness

Skill yzp100911/CrabAgent/xCrab/skills/browser-harness

A localized intelligent agent platform suitable for human-machine romance: cclaw (agent side) + eclaw (backend) + wclaw (frontend) + xCrab (AI gateway). 一个适合搞人机恋的本地化智能体(Agent)平台:cclaw(代理端)+ eclaw(后端)+ wclaw(前端)+ xCrab(AI 网关)。懂的都懂!

Install
npx -y skills add yzp100911/CrabAgent --skill browser-harness

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

浏览器自动化控制。通过 CDP 连接用户本机 Edge/Chrome,实现网页截图、内容提取、自动化操作。当用户需要:打开网页并截图、提取网页动态内容、看 JS 渲染的页面、自动化操作浏览器时触发。

SKILL.md

2.7 KB, as published. Nobody here has run it

Browser Harness 技能

通过 browser-harness CLI 控制用户本机浏览器(Edge 或 Chrome)。

前置条件

  1. 本机已安装 browser-harness

    git clone https://github.com/browser-use/browser-harness
    cd browser-harness
    uv tool install -e .
    
  2. 浏览器调试模式启动

    # Edge(推荐):
    "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --remote-debugging-port=9222
    
    # 或 Chrome:
    "C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222
    
  3. 设置环境变量(每次使用前):

    $env:BU_CDP_URL="http://127.0.0.1:9222"
    

常用命令

截图

browser-harness -c "new_tab('https://example.com'); wait_for_load(); capture_screenshot()"

截图保存到 C:\Users\he\AppData\Local\Temp\shot.png,用完后复制到工作目录分析。

打开网页

browser-harness -c "new_tab('https://example.com')"           # 新标签页打开
browser-harness -c "goto_url('https://example.com')"        # 在当前标签页打开

等待页面加载

browser-harness -c "new_tab('https://example.com'); wait_for_load()"

获取页面信息

browser-harness -c "print(page_info())"  # URL、标题、尺寸
browser-harness -c "js('document.body.innerText')"  # 页面文字内容

提取页面内容

browser-harness -c "js('document.title')"  # 标题
browser-harness -c "js('document.querySelectorAll(\"a\").length')"  # 链接数量

关闭标签页

browser-harness -c "close_tab()"

注意事项

  • 新标签用 new_tab(),不要用 goto_url()(会覆盖用户当前页面)
  • 截图后C:\Users\he\AppData\Local\Temp\shot.png 复制出来分析
  • 等待加载wait_for_load() 在导航后必须调用
  • JS 渲染页面web_fetch 抓不到的页面可以用这个
  • 视频内容:只能看到封面和文字,看不到实际视频内容
  • 云端浏览器:设置 BROWSER_USE_API_KEYstart_remote_daemon() 可用远程浏览器

故障排除

连接失败

# 检查调试端口是否开启
Invoke-RestMethod "http://localhost:9222/json/version"
# 有返回说明端口正常

重启浏览器调试

Stop-Process -Name msedge -Force
Start-Process "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --remote-debugging-port=9222

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.