File contents Scrapling 网页抓取 Skill
步骤 0:检查版本
python -c "import scrapling; print(scrapling.__version__)"
按项目使用的包管理器执行(pip / uv 等价命令见 references/maintenance.md):
未安装 → 安装 scrapling[fetchers] + scrapling install
有新版 → 升级 → 查 changelog 告知用户
已最新 → 继续
项目根存在 uv.lock 或 pyproject.toml 含 [tool.uv],优先用 uv(uv add / uv run scrapling install);否则用 pip。
步骤 1:选择 Fetcher
目标网站 →
│
├─ 已有 HTML 字符串/文件,只需解析?
│ → Selector(纯解析,无网络请求)
│ → 模板: parse_only.py
│
├─ 静态页面,无 JS 渲染,无反爬?
│ → Fetcher(最快,基于 curl_cffi)
│ → 模板: basic_fetch.py
│
├─ 需要登录(HTTP 表单,非 JS 登录)?
│ → FetcherSession(保持会话 cookie)
│ → 模板: session_login.py
│
├─ 有 Cloudflare / WAF 保护?
│ → StealthyFetcher(Camoufox 浏览器,自动过 CF)
│ → 模板: stealth_cloudflare.py
│
├─ SPA 应用(React/Vue),需要 JS 渲染?
│ → DynamicFetcher(Playwright 浏览器)
│ → 基于模板即时生成
│
└─ 不确定?
→ 先用 Fetcher 试,403/空内容 → 升级到 StealthyFetcher
步骤 2:执行工作流
1. 检查版本(步骤 0)
2. 查阅 references/site-patterns.md — 匹配已有模式则直接复用
3. 无匹配 → 用决策树选择 Fetcher
4. 读取对应模板 → 替换参数 → 生成完整脚本
5. 执行脚本 → 返回结果
6. **沉淀经验(必做)**:
- 新站点 → 追加到 site-patterns.md
- 新 cookie / 用户提供了 cookie → 保存到 cookie-vault.md
- **完成抓取后必须检查**:是否有新的 cookie 或 site pattern 需要保存
Cookie 格式速查
Fetcher 类型
Cookie 格式
示例
Fetcher / FetcherSession
dict
{'name': 'value', 'token': 'abc'}
StealthyFetcher / DynamicFetcher
list[dict]
[{'name': 'n', 'value': 'v', 'domain': '.site.com', 'path': '/'}]
浏览器 Fetcher cookie 必填字段 : name, value, domain, path
超时单位速查
Fetcher 类型
超时单位
示例
Fetcher / FetcherSession
秒
timeout=30
StealthyFetcher / DynamicFetcher
毫秒
timeout=60000
模板索引
模板
文件
何时读取
基础 HTTP 抓取
templates/basic_fetch.py
目标为静态页面,无反爬
Cloudflare 绕过
templates/stealth_cloudflare.py
目标有 CF/WAF 保护
Session 登录
templates/session_login.py
需 HTTP 表单登录后抓取
纯 HTML 解析
templates/parse_only.py
已有 HTML 字符串,只需提取数据
References 索引
文件
何时读取
references/site-patterns.md
每次抓取前先查阅 — 检查目标站点是否有已记录的模式
references/api-quick-ref.md
生成脚本时查阅 — Fetcher/Selector 方法签名和参数
references/troubleshooting.md
执行报错时查阅 — 按错误信息查找原因和解决方案
references/cookie-vault.md
需要登录 cookie 时查阅 — 检查是否有历史记录可复用
references/maintenance.md
安装/升级/依赖问题时查阅 — 安装层级和验证命令
Source: Cedriccmh/claude-code-skill-scrapling — distributed by TomeVault .
1 --- 2 name: cedriccmh-claude-code-skill-scrapling-claude-code-skill-scra 3 description: Scrapling 网页抓取 Skill 4 --- 5 6 # Scrapling 网页抓取 Skill 7 8 ## 步骤 0:检查版本 9 10 ```bash 11 python -c "import scrapling; print(scrapling.__version__)" 12 ``` 13 14 按项目使用的包管理器执行(pip / uv 等价命令见 `references/maintenance.md`): 15 16 - 未安装 → 安装 `scrapling[fetchers]` + `scrapling install` 17 - 有新版 → 升级 → 查 changelog 告知用户 18 - 已最新 → 继续 19 20 > 项目根存在 `uv.lock` 或 `pyproject.toml` 含 `[tool.uv]`,优先用 `uv`(`uv add` / `uv run scrapling install`);否则用 `pip`。 21 22 ## 步骤 1:选择 Fetcher 23 24 ``` 25 目标网站 → 26 │ 27 ├─ 已有 HTML 字符串/文件,只需解析? 28 │ → Selector(纯解析,无网络请求) 29 │ → 模板: parse_only.py 30 │ 31 ├─ 静态页面,无 JS 渲染,无反爬? 32 │ → Fetcher(最快,基于 curl_cffi) 33 │ → 模板: basic_fetch.py 34 │ 35 ├─ 需要登录(HTTP 表单,非 JS 登录)? 36 │ → FetcherSession(保持会话 cookie) 37 │ → 模板: session_login.py 38 │ 39 ├─ 有 Cloudflare / WAF 保护? 40 │ → StealthyFetcher(Camoufox 浏览器,自动过 CF) 41 │ → 模板: stealth_cloudflare.py 42 │ 43 ├─ SPA 应用(React/Vue),需要 JS 渲染? 44 │ → DynamicFetcher(Playwright 浏览器) 45 │ → 基于模板即时生成 46 │ 47 └─ 不确定? 48 → 先用 Fetcher 试,403/空内容 → 升级到 StealthyFetcher 49 ``` 50 51 ## 步骤 2:执行工作流 52 53 ``` 54 1. 检查版本(步骤 0) 55 2. 查阅 references/site-patterns.md — 匹配已有模式则直接复用 56 3. 无匹配 → 用决策树选择 Fetcher 57 4. 读取对应模板 → 替换参数 → 生成完整脚本 58 5. 执行脚本 → 返回结果 59 6. **沉淀经验(必做)**: 60 - 新站点 → 追加到 site-patterns.md 61 - 新 cookie / 用户提供了 cookie → 保存到 cookie-vault.md 62 - **完成抓取后必须检查**:是否有新的 cookie 或 site pattern 需要保存 63 ``` 64 65 ## Cookie 格式速查 66 67 | Fetcher 类型 | Cookie 格式 | 示例 | 68 |-------------|-------------|------| 69 | Fetcher / FetcherSession | `dict` | `{'name': 'value', 'token': 'abc'}` | 70 | StealthyFetcher / DynamicFetcher | `list[dict]` | `[{'name': 'n', 'value': 'v', 'domain': '.site.com', 'path': '/'}]` | 71 72 **浏览器 Fetcher cookie 必填字段**: `name`, `value`, `domain`, `path` 73 74 ## 超时单位速查 75 76 | Fetcher 类型 | 超时单位 | 示例 | 77 |-------------|---------|------| 78 | Fetcher / FetcherSession | 秒 | `timeout=30` | 79 | StealthyFetcher / DynamicFetcher | 毫秒 | `timeout=60000` | 80 81 ## 模板索引 82 83 | 模板 | 文件 | 何时读取 | 84 |------|------|---------| 85 | 基础 HTTP 抓取 | `templates/basic_fetch.py` | 目标为静态页面,无反爬 | 86 | Cloudflare 绕过 | `templates/stealth_cloudflare.py` | 目标有 CF/WAF 保护 | 87 | Session 登录 | `templates/session_login.py` | 需 HTTP 表单登录后抓取 | 88 | 纯 HTML 解析 | `templates/parse_only.py` | 已有 HTML 字符串,只需提取数据 | 89 90 ## References 索引 91 92 | 文件 | 何时读取 | 93 |------|---------| 94 | `references/site-patterns.md` | **每次抓取前先查阅** — 检查目标站点是否有已记录的模式 | 95 | `references/api-quick-ref.md` | 生成脚本时查阅 — Fetcher/Selector 方法签名和参数 | 96 | `references/troubleshooting.md` | 执行报错时查阅 — 按错误信息查找原因和解决方案 | 97 | `references/cookie-vault.md` | 需要登录 cookie 时查阅 — 检查是否有历史记录可复用 | 98 | `references/maintenance.md` | 安装/升级/依赖问题时查阅 — 安装层级和验证命令 | 99 100 --- 101 > Source: [Cedriccmh/claude-code-skill-scrapling](https://github.com/Cedriccmh/claude-code-skill-scrapling) — distributed by [TomeVault](https://tomevault.io). 102 <!-- tomevault:4.0:skill_md:2026-06-15 -->
tomevault-io/skills-registry/tree/main/cedriccmh--claude-code-skill-scrapling--claude-code-skill-scrapling commit 3c3b825ef1
Frequently asked questions How do I install the Cedriccmh Claude Code Skill Scrapling Claude Code Skill Scrapling skill? Run npx skillmds@latest add tomevault-io/cedriccmh-claude-code-skill-scrapling-claude-code-skill-scra in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
What does the Cedriccmh Claude Code Skill Scrapling Claude Code Skill Scrapling skill do? Scrapling 网页抓取 Skill It is listed under Coding & Dev Tools on SkillMD.
Is Cedriccmh Claude Code Skill Scrapling Claude Code Skill Scrapling safe to use? This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
Which AI agents work with Cedriccmh Claude Code Skill Scrapling Claude Code Skill Scrapling? This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Is Cedriccmh Claude Code Skill Scrapling Claude Code Skill Scrapling free to use? Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Who published Cedriccmh Claude Code Skill Scrapling Claude Code Skill Scrapling? tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.