garfield247/agent-skill-python-crawler/python-crawler

Claude Code and agent skill by garfield247/agent-skill-python-crawler

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Python 3.10+ 网络爬虫、逆向解析、反反爬对抗与大规模数据采集工程规范技能。 涵盖协议逆向优先原则、httpx 异步连接池与并发限流 (Semaphore)、Playwright 动态渲染与资源拦截优化、 TLS/JA3 指纹伪装 (curl_cffi)、代理池轮换、指数退避重试 (Tenacity) 及强制 Docstring 请求/响应样例工程红线。

Install

npx vskill@latest install garfield247/agent-skill-python-crawler/python-crawler

SKILL.md

The same SKILL.md was published earlier as garfield247/agent-skill-python-crawler/python-crawler.

Python 3.10+ 网络爬虫与数据采集工程规范 (Python Crawler Mastery Skill)

本技能定义了构建高并发、高弹性、抗反爬 Python 网络爬虫流水线时的架构准则、质量红线与渐进式手册索引。


1. 核心铁律与绝对红线 (Core Redlines)

  1. 🚨 逆向协议优先原则 (Reverse-Engineering First):
  • 抓包分析 XHR/Fetch/WebSocket 协议绝对优先于解析 HTML,更优先于 Headless 浏览器渲染;
  • 坚决杜绝在未抓包分析 API 前无脑拉起 Playwright/Selenium。
  1. 🚨 强制 Docstring 携带真实请求/响应样例 (Sample Rule):
  • 所有封装网络请求与数据提取的函数,必须在 Docstring 中包含真实的 Request Sample 与 Response Sample;
  • 字段变动时以 Docstring 中的标准报文为唯一核对仲裁依据。
  1. 🚨 异步连接池与并发限流门禁:
  • 严禁每次请求新建 httpx.AsyncClient,必须复用单例保持长连接热活并配置显式超时;
  • 必须通过 asyncio.Semaphore 限制并发窗口,配合 tenacity 进行带抖动的指数退避重试,严禁裸死循环。
  1. 🚨 Playwright 降载与防御性解析:
  • 使用 Playwright 时必须挂载路由拦截,阻断图片、媒体、字体等无关资源(降低 70%+ 负载);
  • 页面等待严禁无脑 networkidle(防持续心跳挂死);数据提取统一使用 selectolax + Pydantic 防御解析。

2. 标准开发工作流 (Standard Workflow)

  1. 抓包勘测:通过 DevTools 锁定目标数据真实的 XHR/JSON 接口与入参加密逻辑;
  2. 契约记录:在抓取函数顶部 Docstring 中记录标准 Request/Response 样例;
  3. 异步封装:使用 httpx.AsyncClient + Semaphore 实现带限流与 Tenacity 重试的采集器;
  4. 防御提取:利用 selectolax 解析并转录为 Pydantic 强类型 Item;
  5. 风控应对:遇 TLS 阻断切换至 curl_cffi,遇动态混淆加密接入 Playwright + Stealth。

3. 渐进式专业参考手册 (Progressive Disclosure References)

根据具体涉及的业务场景,按需查阅 `references/` 目录下的专门规约,严禁将全量子文档一次性无脑全部展开:

场景模块参考子文档核心涵盖规范
选型矩阵与契约样例01_technology_matrix_and_docstrings.md• HTTP / 指纹伪装 / Headless 浏览器选型矩阵<br>• 强制 Docstring 请求与响应真实样例范式
异步并发与退避重试02_async_concurrency_and_tenacity.md• httpx.AsyncClient 连接池与超时配置<br>• asyncio.Semaphore 信号量精准限流<br>• Tenacity 随机抖动指数退避重试
Playwright 优化与隐身03_playwright_optimization_and_stealth.md• 静态资源拦截削减 70%+ 资源负载<br>• 自动化驱动标记抹除与 Stealth 隐身机制<br>• domcontentloaded + 选择器显式等待
防御性解析与布隆判重04_defensive_parsing_and_bloom_filter.md• selectolax C 内核安全提取与 Pydantic 清洗<br>• Redis 布隆过滤器千万级判重与断点续爬检查点
反反爬排障速查武器库05_anti_scraping_troubleshooting.md• HTTP 403 (TLS/JA3)、429 频控速查<br>• Playwright 超时挂死排障矩阵

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/garfield247/agent-skill-python-crawler/python-crawler/badge)](https://verified-skill.com/skills/garfield247/agent-skill-python-crawler/python-crawler)

Something wrong with this skill or its page? Tell us.