Loading...
Loading...
Compare original and translation side by side
Playwriter exploration -> CDP evidence capture -> Documentation -> Code generation
crawler.hypercore/crawler/<ACTION>.jsoncrawler| Trigger | Action |
|---|---|
| Reusable crawling, scraping, or site-wide extraction | Run immediately |
| Site investigation or API reverse engineering for crawling | Start discovery and API interception |
| One-off extraction from a single page | Treat as a boundary case and keep the workflow lightweight unless reusable crawl work is requested |
| Anti-bot bypass or Cloudflare-heavy target | Start with risk checks and Anti-Detect guidance |
API.mdNETWORK.md.hypercore/crawler/<ACTION>.json.hypercore/crawler/[site]/Playwriter探索 -> CDP证据捕获 -> 文档记录 -> 代码生成
crawler.hypercore/crawler/<ACTION>.jsoncrawler| 触发条件 | 操作 |
|---|---|
| 可复用爬取、数据抓取或全站提取 | 立即执行 |
| 为爬取而进行的网站调研或API逆向工程 | 启动发现和API拦截 |
| 单页面的一次性提取 | 视为边界情况,保持工作流程轻量化,除非请求可复用爬取工作 |
| 反爬虫绕过或Cloudflare防护较强的目标 | 从风险检查和反检测指导开始 |
API.mdNETWORK.md.hypercore/crawler/<ACTION>.json.hypercore/crawler/[site]/sequential-thinkingsequential-thinkingsequential-thinkingANALYSIS.md403/429/503CRAWLER.ts| Phase | Task | Command/Method |
|---|---|---|
| 1. Session | Create session + open page | |
| 2. Explore | Reproduce the page flow with Playwriter | |
| 3. Capture | Collect network/auth/perf evidence via | |
| 4. Analyze | Decide API-first vs DOM-first | network-crawling.md, selector-strategies.md |
| 5. Document | Save findings under | Write |
| 6. Code | Generate crawler implementation | code-templates.md |
| Condition | Method | Notes |
|---|---|---|
| API found via CDP or fallback browser-network evidence + simple auth | | Fastest |
| API + cookie/token required | | Requires expiry handling |
| API + Cloudflare / DataDome / JA3 fingerprinting | | Restores TLS/JA3; pair with residential proxy |
| Discovery / live network + perf evidence | | First-party CDP fidelity (network, console, perf trace, Lighthouse) — see chrome-devtools-mcp.md |
| Page driving / login / lazy-load triggering | | "Make the page do the thing" |
| Strong anti-bot (Cloudflare, DataDome) | Patchright or rebrowser-patches | Patches Chromium / patches |
| Chromium-specific fingerprinting | Camoufox | Firefox-based stealth fork |
| No API (SSR) and no anti-bot | Playwright DOM | Parse directly |
.hypercore/crawler/<ACTION>.jsonACTION.json.hypercore/crawler/[site-name]/.hypercore/crawler/
├── <ACTION>.json # durable action context
└── [site-name]/
├── ANALYSIS.md
├── SELECTORS.md
├── API.md
├── NETWORK.md
├── raw/
│ ├── network-summary.json
│ ├── auth-signals.json
│ └── endpoint-candidates.json
└── CRAWLER.ts.hypercore/crawler/[site-name]/
├── ANALYSIS.md # Site structure
├── SELECTORS.md # DOM selectors
├── API.md # API endpoints
├── NETWORK.md # Auth/network details
├── raw/
│ ├── network-summary.json # normalized request/response evidence
│ ├── auth-signals.json # cookies/storage/header evidence
│ └── endpoint-candidates.json # deduped API candidates
└── CRAWLER.ts # Generated crawler code.hypercore/crawler/<ACTION>.jsonANALYSIS.mdSELECTORS.mdAPI.mdNETWORK.mdraw/network-summary.jsonraw/auth-signals.jsonraw/endpoint-candidates.jsonCRAWLER.tsANALYSIS.mdNETWORK.mdACTION.jsonstatuscapture_modeCRAWLER.ts✅ Playwriter session created
✅ `ACTION.json` created when the run is reusable, blocked, or resumable
✅ Structure analyzed with limited Playwriter snapshots
✅ CDP capture attempted for network/auth evidence
✅ raw evidence files recorded when CDP capture is available, or the fallback limitation documented when it is not
✅ Selector extraction validated
✅ Findings documented under .hypercore/crawler/
✅ Crawler code generated
✅ sequential-thinking trace recorded for major phases
✅ legal, rate-limit, and bot-detection blockers documented before scaling
✅ blocked runs reported explicitly when crawler code is unsafe or premature
✅ `ACTION.json` status and `site_dir` match the actual run outputs
✅ completed runs leave `ACTION.json.next_step` empty or terminal and point outputs at final files| Category | Forbidden |
|---|---|
| Analysis | Guess selectors without structure analysis |
| Approach | Use DOM-only flow without checking APIs |
| Documentation | Skip documenting analysis results |
| Network | Ignore rate limiting |
undefinedsequential-thinkingsequential-thinkingsequential-thinkingANALYSIS.md403/429/503CRAWLER.ts| 阶段 | 任务 | 命令/方法 |
|---|---|---|
| 1. 会话 | 创建会话 + 打开页面 | |
| 2. 探索 | 使用Playwriter复现页面流程 | |
| 3. 捕获 | 通过 | |
| 4. 分析 | 决定优先使用API还是DOM | network-crawling.md, selector-strategies.md |
| 5. 文档记录 | 将调研结果保存到 | 编写 |
| 6. 代码生成 | 生成爬虫实现代码 | code-templates.md |
| 条件 | 方法 | 说明 |
|---|---|---|
| 通过CDP或备用浏览器网络证据发现API + 简单认证 | | 速度最快 |
| API + 需要Cookie/令牌 | | 需要处理过期问题 |
| API + Cloudflare / DataDome / JA3指纹识别 | | 恢复TLS/JA3;搭配住宅代理使用 |
| 发现 / 实时网络 + 性能证据 | | 原生CDP保真度(网络、控制台、性能追踪、Lighthouse) — 详见chrome-devtools-mcp.md |
| 页面驱动 / 登录 / 触发懒加载 | | "让页面执行操作" |
| 强反爬虫(Cloudflare、DataDome) | Patchright 或 rebrowser-patches | 修补Chromium / 修补 |
| Chromium特定指纹识别 | Camoufox | 基于Firefox的隐身分支 |
| 无API(SSR)且无反爬虫 | Playwright DOM | 直接解析 |
.hypercore/crawler/<ACTION>.jsonACTION.json.hypercore/crawler/[site-name]/.hypercore/crawler/
├── <ACTION>.json # 持久化操作上下文
└── [site-name]/
├── ANALYSIS.md
├── SELECTORS.md
├── API.md
├── NETWORK.md
├── raw/
│ ├── network-summary.json
│ ├── auth-signals.json
│ └── endpoint-candidates.json
└── CRAWLER.ts.hypercore/crawler/[site-name]/
├── ANALYSIS.md # 网站结构
├── SELECTORS.md # DOM选择器
├── API.md # API端点
├── NETWORK.md # 认证/网络详情
├── raw/
│ ├── network-summary.json # 标准化请求/响应证据
│ ├── auth-signals.json # Cookie/存储/请求头证据
│ └── endpoint-candidates.json # 去重后的API候选端点
└── CRAWLER.ts # 生成的爬虫代码.hypercore/crawler/<ACTION>.jsonANALYSIS.mdSELECTORS.mdAPI.mdNETWORK.mdraw/network-summary.jsonraw/auth-signals.jsonraw/endpoint-candidates.jsonCRAWLER.tsANALYSIS.mdNETWORK.mdACTION.jsonstatuscapture_modeCRAWLER.ts✅ 创建Playwriter会话
✅ 当运行可复用、阻塞或可恢复时,创建`ACTION.json`
✅ 使用有限的Playwriter快照分析结构
✅ 尝试使用CDP捕获网络/认证证据
✅ 当CDP捕获可用时记录原始证据文件,当不可用时记录备用方案的限制
✅ 验证选择器提取
✅ 将调研结果记录在.hypercore/crawler/目录下
✅ 生成爬虫代码
✅ 为主要阶段记录sequential-thinking轨迹
✅ 在扩大规模前记录法律、速率限制和反爬虫阻塞问题
✅ 当爬虫代码不安全或过早生成时,明确报告阻塞运行
✅ `ACTION.json`的状态和`site_dir`与实际运行输出匹配
✅ 完成的运行将`ACTION.json.next_step`设为空或终端状态,并将输出指向最终文件| 类别 | 禁止操作 |
|---|---|
| 分析 | 未进行结构分析就猜测选择器 |
| 方案 | 未检查API就仅使用DOM流程 |
| 文档记录 | 跳过分析结果的记录 |
| 网络 | 忽略速率限制 |
undefined
</example>
</example>