Install
openclaw skills install @fslong520/urlgoopenclaw skills install @fslong520/urlgo浏览器, CDP, 截图, 网页, 打开网页, HTML源码
连 CDP,开网页,截图,执行 JS。
路径:python3 /home/fslong/.config/opencode/skills/urlgo/urlgo
python3 /home/fslong/.config/opencode/skills/urlgo/urlgo status → CDP 开了没?python3 /home/fslong/.config/opencode/skills/urlgo/urlgo start → 启动浏览器(后台运行,脚本退出后浏览器不关)python3 /home/fslong/.config/opencode/skills/urlgo/urlgo open <url> → 打开页面(仅限首页/入口 URL)python3 /home/fslong/.config/opencode/skills/urlgo/urlgo screenshot <id> <file> → 截图python3 /home/fslong/.config/opencode/skills/urlgo/urlgo snapshot <id> → 读取页面内容(纯文字)python3 /home/fslong/.config/opencode/skills/urlgo/urlgo source <id> → 获取页面 HTML 源码⚠️ 导航铁律:页面内点击,禁止手工拼接 URL。 进站后的一切跳转(翻页、点链接、点按钮、选试卷、提交表单)必须:
source <id>取源码,从 HTML 里找到目标链接/按钮;click <id> "<selector>"或eval <id> "document.querySelector('...').click()"在页面内点击;- 严禁手工拼接带参 URL 再用
open打开——&会被截断、Referer 校验会失败、会话/登录态丢失,三害俱全。open只用于初始入口(首页、登录页)。
AVOID:
urlgo 命令(PATH 可能没有),必须用完整 Python 路径? &)再用 open 打开——会被截断或 Referer 拦截,必须页面内点击(见上方导航铁律)| 命令 | 说明 |
|---|---|
status | 检查 CDP |
start | 启动浏览器(后台运行,进程退出后浏览器不关) |
list | 查看页面 |
open <url> | 打开网页 |
activate <id> | 激活页面 |
close <id> | 关闭页面 |
screenshot <id> <file> | 截图 |
snapshot <id> | 读取内容(纯文字) |
source <id> | 获取 HTML 源码 |
eval <id> "<js>" | 执行 JS |
click <id> "<sel>" | 点击 |
type <id> "<sel>" "<text>" | 输入 |
python3 /home/fslong/.config/opencode/skills/urlgo/urlgo start
python3 /home/fslong/.config/opencode/skills/urlgo/urlgo open https://example.com
python3 /home/fslong/.config/opencode/skills/urlgo/urlgo snapshot 1
python3 /home/fslong/.config/opencode/skills/urlgo/urlgo source 1
python3 /home/fslong/.config/opencode/skills/urlgo/urlgo screenshot 1 /tmp/a.png
curl, websockets(Python)