支持自动绕过 Cloudflare Turnstile 和微信公众号反爬机制的网页内容抓取工具,输出干净Markdown或纯文本。
~/.openclaw/workspace/.venv/bin/python3 \
~/.openclaw/workspace/skills/scrapling-fetch/scripts/fetch.py \
"https://mp.weixin.qq.com/s/xxxxxx"
~/.openclaw/workspace/.venv/bin/python3 \
~/.openclaw/workspace/skills/scrapling-fetch/scripts/fetch.py \
"https://example.com" \
--fast
默认输出 JSON:
{
"title": "文章标题",
"author": "作者",
"content": "正文内容(Markdown格式)",
"word_count": 1234
}
加 --text 参数只输出纯文本。
| 网站类型 | 推荐工具 | 原因 |
|---|---|---|
| 微信公众号 | Scrapling | 自动绕过反爬 ✅ |
| Medium/Substack | Scrapling | 绕过反爬机制 |
| Cloudflare 保护 | Scrapling | 支持 Turnstile 绕过 |
| 普通技术博客 | Jina(--fast) | 速度快(1.4秒) |
| GitHub/静态页面 | web_fetch | 无需额外工具 |
核心功能:
参数:
url - 必填,目标网址--fast - 使用 Jina Reader(适合普通网页)--text - 只输出纯文本(默认 JSON)--max-chars - 最大字符数(默认 50000)示例:
# 抓取微信文章
python3 fetch.py "https://mp.weixin.qq.com/s/xxxxx"
# 快速抓取普通网页
python3 fetch.py "https://blog.example.com" --fast
# 限制长度
python3 fetch.py "https://example.com" --max-chars 10000
用户发链接 → scrapling-fetch 抓取 → AI 消化 → 生成内容
# 批量抓取多篇公众号文章
for url in "url1" "url2" "url3"; do
python3 fetch.py "$url" >> articles.jsonl
done
# web_fetch 失败 → 自动切换 Scrapling
if ! web_fetch "$url"; then
python3 fetch.py "$url"
fi
Scrapling 核心特性:
Jina Reader:
https://r.jina.ai/{url}# 付费模式(需要 user_id)
python3 fetch_paid.py "https://mp.weixin.qq.com/s/xxxxx" --user-id user123
# 免费模式(不计费)
python3 fetch_paid.py "https://mp.weixin.qq.com/s/xxxxx" --free
获取 API Key
sk_ 开头)修改配置
# 编辑 fetch_paid.py
BILLING_API_KEY = 'sk_your_api_key_here'
测试扣费
python3 fetch_paid.py "https://example.com" --user-id test_user
{
"error": "余额不足",
"balance": 0.005,
"payment_url": "https://skillpay.me/pay/xxx",
"hint": "请充值后继续使用"
}
| 接口 | 方法 | 说明 |
|---|---|---|
/api/v1/billing/balance | GET | 查询余额 |
/api/v1/billing/charge | POST | 扣费 |
/api/v1/billing/payment-link | POST | 生成充值链接 |
| 场景 | 调用量/天 | 日收入 | 月收入 |
|---|---|---|---|
| 个人使用 | 10 次 | $0.10 | $3 |
| 小团队 | 100 次 | $1.00 | $30 |
| 公开服务 | 1000 次 | $10.00 | $300 |
web_fetch - 轻量级网页抓取(无反爬绕过)browser - 浏览器自动化(需要手动操作)xurl - 推特 API(需配置)ZIP package — ready to use