Obscura Skill — Obscura 技能
v1.0.0Use when scrAPIng the 网页, driving headless browser 自动化, or 运行ning E2E tests from Claude Code. Obscura is a Rust-based, drop-in headless Chrome repla...
详细分析 ▾
运行时依赖
安装命令
点击复制本土化适配说明
Obscura Skill — Obscura 技能 安装说明: 安装命令:["openclaw skills install obscura-skill","npx clawhub@latest install obscura-skill"]
技能文档
Obscura — 面向 AI 代理与网页抓取的无头浏览器 源码:https://github.com/h4ckf0r0day/obscura 许可证:Apache 2.0
概述 Obscura 是用 Rust 编写的开源无头浏览器引擎,通过 V8 执行真实 JavaScript,支持 Chrome DevTools Protocol,可无缝替代 Puppeteer/Playwright 的无头 Chrome,但内存仅 ~30 MB(对比 200+ MB),启动瞬间完成。
适用场景
- CLI 抓取重度 JS 页面
- 无需打包 Chromium 即可运行 Puppeteer/Playwright 脚本
- 为 AI 代理启动 CDP 服务器供其控制
- 绕过简单反爬(内置 stealth + 跟踪器拦截)
- 低内存并行抓取大量 URL
触发动作
用户想单 URL JS 渲染 → obscura fetch
用户想并行抓取多 URL → obscura scrape url1 url2 …
用户已有 Puppeteer/Playwright 脚本 → 启动 obscura serve 并通过 CDP 连接
页面带反爬 → 加 --stealth
咨询反检测/指纹 → 推荐 stealth 版本
安装 macOS (Apple Silicon)
curl -LO https://github.com/h4ckf0r0day/obscura/releases/latest/download/obscura-aarch64-macos.tar.gz
tar xzf obscura-aarch64-macos.tar.gz
sudo mv obscura /usr/local/bin/
obscura --version
macOS (Intel) 与 Linux x86_64 同理,替换对应包名。
Windows:在 Releases 下载 .zip 并加入 PATH。 源码构建(带 stealth)
git clone https://github.com/h4ckf0r0day/obscura.git
cd obscura
cargo build --release --features stealth
# 二进制:./target/release/obscura
需 Rust 1.75+;首次编译约 5 min(V8 源码),后续缓存。 验证
obscura fetch https://example.com --eval "document.title"
# 输出:Example Domain
用法
- 单页抓取
obscura fetch https://example.com --eval "document.title"
obscura fetch https://news.ycombinator.com --dump html
obscura fetch https://example.com --dump links
obscura fetch https://example.com --dump text
obscura fetch https://example.com --wait-until networkidle0
obscura fetch https://example.com --selector ".article-body"
- 并行抓取
obscura scrape \
https://example.com/page-1 \
https://example.com/page-2 \
https://example.com/page-3 \
--concurrency 25 \
--eval "document.querySelector('h1').textContent" \
--format json
- 启动 CDP 服务器
obscura serve --port 9222
obscura serve --port 9222 --stealth
obscura serve --port 9222 --proxy socks5://127.0.0.1:1080
obscura serve --port 9222 --workers 4
Node 连接示例(Puppeteer/Playwright)见原文。 - 表单提交与登录
React 等 SPA 的端到端测试 用 Obscura 替代 Chrome,测试提速 5–10×。