web-fetch
Skill1 starsChanged 8 months agoMITView on GitHub
万能网页抓取工具,支持多种策略绕过反爬虫检测。触发词:抓取网页、获取网页内容、scrape。
- Installs packages
12 other projects use a version of this.
Adopted by
Most recently taken up by
- tonyfettes/skillstheir own version, first seen Nov 8, 2026
- Mathews-Tom/armorytheir own version, first seen Nov 1, 2026
- runxhq/runxtheir own version, first seen Oct 13, 2026
- superbereza/lobster-powerstheir own version, first seen Oct 11, 2026
- jholhewres/devclaw-skillstheir own version, first seen Oct 9, 2026
- Lingyuzhou111/dow-ipad-859their own version, first seen Oct 8, 2026
Other versions12 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 12
- Mathews-Tom/armory★ 340same name
- Lingyuzhou111/dow-ipad-859★ 260same name
- runxhq/runx★ 97same name
- archibate/agent-skills★ 16same name
- code-yeongyu/web-fetch★ 4same name
- jholhewres/devclaw-skills★ 4same name
- smart-lty/my-skills★ 4same name
- seven-steven/skills★ 1same name
- tonyfettes/skills★ 1same name
- Bobtron/piAgentSkills★ 0same name
2 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository40 other files it gives its agents.
- ralphSkill
- prdSkill
- th-prd-driven-dev-workflowSkill
- th-ralph-evoSkill
- th-ralphSkill
- th-workflow-decision-engineSkill
- agent-factorySkill
- arch-linuxSkill
- article-writingSkill
- browser-useSkill
- code-reviewSkill
- decision-recordSkill
- githubSkill
- knowledge-hubSkill
- long-doc-generatorSkill
- long-running-agentSkill
- th-model-compare-searchSkill
- newapi-cliSkill
- orchestratorSkill
- playwright-cliSkill
- prd-evolutionSkill
- prd-to-codeSkill
- prompt-expertSkill
- prompt-optimizerSkill
- puppeteer-cliSkill
- ralphSkill
- prdSkill
- requirement-to-prdSkill
- site-analyzerSkill
- skill-creatorSkill
- skill-stocktakeSkill
- src-linkSkill
- th-bug-analyzerSkill
- th-deep-coder2Skill
- th-deep-coderSkill
- th-enterprise-test-agentSkill
- gitnexus-assistantSkill
- th-ralph-evoSkill
- th-ralphSkill
- unified-searchSkill
The file
Files
Web Fetch - 万能网页抓取工具
版本: v1.0 创建日期: 2026-03-15
核心优势: 多策略自动切换,从轻量到重量级,智能选择最优方案
📋 概述
统一网页抓取工具,支持 4 种抓取策略:
| 方法 | 速度 | 适用场景 | 反爬虫绕过 |
| curl | ⚡ 最快 | 静态 HTML | ❌ 无 |
| agent-browser | 🚀 快 | 动态 SPA | ✅ 中等 |
| browser-use | 🐢 中 | 复杂交互 | ✅ 强 |
| playwright | 🐌 慢 | 强反爬虫 | ✅✅ 最强 |
自动模式: 从 curl 开始,失败后自动尝试更强的方法
🚀 快速开始
# 基础使用(自动模式)
node ~/src/user-scripts/skills/web-fetch/scripts/fetch-page.mjs "https://example.com"
# 指定方法
node ~/src/user-scripts/skills/web-fetch/scripts/fetch-page.mjs "https://example.com" --method browser-use
# 带截图
node ~/src/user-scripts/skills/web-fetch/scripts/fetch-page.mjs "https://example.com" --screenshot out.png
# JSON 输出
node ~/src/user-scripts/skills/web-fetch/scripts/fetch-page.mjs "https://example.com" --json📤 命令参数
| 参数 | 说明 | 默认值 |
--method METHOD | 抓取方法:auto, curl, playwright, all | auto |
--timeout MS | 超时时间(毫秒) | 30000 |
--retry / --no-retry | 是否启用重试 | true |
--output FILE | 保存内容到文件 | - |
--screenshot FILE | 保存截图 | - |
--wait N | 等待 N 秒后获取 | 0 |
--ua UA | 自定义 User-Agent | 随机 |
--json | JSON 输出格式 | false |
--stats | 显示统计报告 | false |
📚 使用示例
1. 快速抓取静态页面
# 获取 GitHub README
node ~/src/user-scripts/skills/web-fetch/scripts/fetch-page.mjs "https://github.com/anthropics/claude-code"
# 获取新闻文章
node ~/src/user-scripts/skills/web-fetch/scripts/fetch-page.mjs "https://example.com/article/123" --output article.html2. 动态 SPA 页面
# React/Vue 应用,等待 3 秒让 JS 执行
node ~/src/user-scripts/skills/web-fetch/scripts/fetch-page.mjs "https://app.example.com" --wait 3 --method playwright3. 带截图
# 获取页面并截图
node ~/src/user-scripts/skills/web-fetch/scripts/fetch-page.mjs "https://example.com" --screenshot page.png4. 绕过反爬虫
# 强反爬虫网站,使用 Playwright
node ~/src/user-scripts/skills/web-fetch/scripts/fetch-page.mjs "https://protected-site.com" --method playwright
# 或者使用 browser-use(带浏览器指纹)
node ~/src/user-scripts/skills/web-fetch/scripts/fetch-page.mjs "https://cloudflare-protected.com" --method browser-use5. JSON 输出(便于程序处理)
node ~/src/user-scripts/skills/web-fetch/scripts/fetch-page.mjs "https://api.example.com" --json | jq '.content'🏗️ 架构设计
方法选择流程
用户请求
↓
auto 模式?
├─ 是 → 尝试 curl → 失败 → playwright
└─ 否 → 直接使用指定方法
↓
获取成功?
├─ 是 → 输出结果
└─ 否 → 重试(最多 3 次,指数退避)方法对比
Curl
# 优点
✅ 最快(~1 秒)
✅ 无需浏览器
✅ 低资源占用
# 缺点
❌ 无法执行 JS
❌ 无法绕过反爬虫Playwright
# 优点
✅ 最强反爬虫绕过
✅ 完整浏览器功能
✅ Stealth 模式隐藏特征
# 缺点
❌ 最慢(~10-20 秒)
❌ 需要安装 playwright⚙️ 配置选项
环境变量
# 设置默认 User-Agent
export WEB_FETCH_UA="Mozilla/5.0 ..."
# 设置默认超时
export WEB_FETCH_TIMEOUT=60000
# 设置默认方法
export WEB_FETCH_METHOD=browser-useCookies 管理
# Cookies 自动保存在 cookies.txt
# 多次请求会自动复用登录状态🧪 测试
# 测试 curl 方法
node ~/src/user-scripts/skills/web-fetch/scripts/fetch-page.mjs "https://example.com" --method curl
# 测试 agent-browser
node ~/src/user-scripts/skills/web-fetch/scripts/fetch-page.mjs "https://example.com" --method agent-browser
# 测试 browser-use
node ~/src/user-scripts/skills/web-fetch/scripts/fetch-page.mjs "https://example.com" --method browser-use
# 测试 playwright
node ~/src/user-scripts/skills/web-fetch/scripts/fetch-page.mjs "https://example.com" --method playwright🐛 故障排查
问题 1:所有方法都失败
# 检查网络连接
curl -I https://example.com
# 检查是否被防火墙阻挡
ping example.com
# 尝试更换 User-Agent
node fetch-page.mjs "url" --ua "Mozilla/5.0 ..."问题 2:内容为空
# 可能是动态内容,增加等待时间
node fetch-page.mjs "url" --wait 5
# 或者使用浏览器方法
node fetch-page.mjs "url" --method browser-use问题 3:反爬虫检测
# 使用最强方法
node fetch-page.mjs "url" --method playwright
# 或者使用 browser-use 的 real 浏览器模式
browser-use --browser real open "url"问题 4:需要登录
# 方法 1:先手动登录,保存 cookies
browser-use --browser real open "https://example.com/login"
# ... 手动登录 ...
browser-use cookies export cookies.json
# 方法 2:使用 browser-use 的 profile
browser-use --browser real --profile "Default" open "https://example.com"📊 输出格式
标准输出
## 网页内容
**URL**: https://example.com
**标题**: Example Domain
**方法**: curl
**耗时**: 1.23s
---
[网页 HTML 内容]JSON 输出
{
"success": true,
"url": "https://example.com",
"title": "Example Domain",
"method": "curl",
"content": "<html>...",
"elapsed": 1234
}🔧 依赖安装
# 基础依赖(curl 方法)
sudo pacman -S curl
# playwright 方法
cd ~/src/user-scripts/skills/web-fetch
npm install playwright puppeteer-extra puppeteer-extra-plugin-stealth
npx playwright install chromium📈 性能对比
| 方法 | 平均耗时 | 成功率 | 资源占用 |
| curl | ~1s | 60% | 低 |
| playwright | ~5-30s | 95% | 高 |
📝 完成标准
触发此 skill 时,任务完成必须满足:
- 网页内容已成功获取
- 输出包含 URL、标题、方法、耗时
- 失败时提供明确的错误信息和建议
- auto 模式已尝试 curl 和 playwright 至少一种方法
📚 参考资源
最后更新:2026-03-15 | 维护:~/src/user-scripts/skills/web-fetch/
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

