Web Scraper — Web Scraping System Construction Pipeline
An agent team collaborates to build target analysis, crawler design, parsing, storage, and monitoring for web scraping systems.
Execution Mode
Agent Team — Five agents communicate directly via SendMessage and perform cross-validation.
Agent Composition
| Agent |
File |
Role |
Type |
| target-analyst |
.claude/agents/target-analyst.md |
Target site analysis, risk assessment |
general-purpose |
| crawler-developer |
.claude/agents/crawler-developer.md |
Crawler architecture and implementation |
general-purpose |
| parser-engineer |
.claude/agents/parser-engineer.md |
Parsing logic design and implementation |
general-purpose |
| data-manager |
.claude/agents/data-manager.md |
Data storage, validation, export |
general-purpose |
| monitor-operator |
.claude/agents/monitor-operator.md |
Monitoring, alerting, scheduling |
general-purpose |
Workflow
Phase 1: Preparation (performed directly by the orchestrator)
- Extract the following from user input:
- Target site URL: Website to scrape
- Target data: What data to extract
- Purpose: Intended use of collected data (analysis/monitoring/archiving)
- Scale: Expected data volume, collection frequency
- Constraints (optional): Tech stack limitations, budget, legal requirements
- Create the
_workspace/ directory at the project root
- Organize the input and save it to
_workspace/00_input.md
- Create the
_workspace/src/ directory
- If pre-existing files are available, copy them to
_workspace/ and skip the corresponding phase
- Determine the execution mode based on the scope of the request (see "Execution Modes" below)
Phase 2: Team Assembly and Execution
Assemble the team and assign tasks. Inter-task dependencies are as follows:
| Order |
Task |
Owner |
Dependencies |
Deliverable |
| 1 |
Target site analysis |
analyst |
None |
_workspace/01_target_analysis.md |
| 2a |
Crawler design and implementation |
crawler |
Task 1 |
_workspace/02_crawler_design.md + src/ |
| 2b |
Parsing logic design and implementation |
parser |
Task 1 |
_workspace/03_parser_logic.md + src/ |
| 3 |
Data storage design |
data-mgr |
Task 2b |
_workspace/04_data_storage.md + src/ |
| 4 |
Monitoring configuration |
monitor |
Tasks 2a, 2b, 3 |
_workspace/05_monitor_config.md + src/ |
Tasks 2a (crawler) and 2b (parser) run in parallel since both depend only on Task 1 (analysis).
Inter-agent communication flow:
- analyst completes > passes URL patterns, anti-bot info, rate limits to crawler; data points and DOM structure to parser
- crawler completes > passes raw data format to parser; crawler health checkpoints to monitor
- parser completes > passes data schema to data-mgr; parsing metrics to monitor
- data-mgr completes > passes data quality metrics to monitor
- monitor integrates all components to finalize operations configuration
Phase 3: Integration and Final Deliverables
- Verify all files in
_workspace/ and _workspace/src/
- Validate cross-deliverable consistency (analysis > crawler > parser > storage > monitoring)
- Present the final summary and execution instructions to the user
Execution Modes by Request Scope
| User Request Pattern |
Execution Mode |
Agents Deployed |
| "Build a full scraping system" |
Full pipeline |
All 5 agents |
| "Analyze target site only" |
Analysis mode |
target-analyst only |
| "Build crawler only" |
Crawler mode |
target-analyst + crawler-developer |
| "Design parser only" |
Parser mode |
target-analyst + parser-engineer |
| "Monitor existing scraper" |
Monitor mode |
monitor-operator only |
Reusing existing files: If the user provides existing analysis results or crawler code, copy to _workspace/ and skip the corresponding agent.
Data Transfer Protocol
| Strategy |
Method |
Purpose |
| File-based |
_workspace/ directory |
Design documents |
| Code-based |
_workspace/src/ |
Executable scraping code |
| Message-based |
SendMessage |
Key information transfer, feedback |
Error Handling
| Error Type |
Strategy |
| Target site inaccessible |
Analyze via cached/archived versions; explore alternative URLs |
| robots.txt blocks all crawling |
Check for public API; propose API-based approach |
| Anti-bot blocks all requests |
Escalate difficulty; propose headless browser or API alternatives |
| Dynamic rendering failure |
Switch to Playwright; increase timeouts |
| Agent failure |
Retry once; if still failing, proceed without that deliverable |
Test Scenarios
Normal Flow
Prompt: "Build a scraper to collect product prices from this e-commerce site daily"
Expected result:
- Analysis: Site structure, pagination, anti-bot mechanisms, robots.txt compliance plan
- Crawler: Async httpx-based crawler with rate limiting and retry logic
- Parser: CSS selector-based price/title/URL extraction with validation
- Storage: SQLite with upsert deduplication, CSV daily export
- Monitoring: Cron schedule, parsing success rate alerts, site change detection
Analysis-Only Flow
Prompt: "Analyze whether this site can be scraped"
Expected result:
- target-analyst performs full analysis and risk assessment
- Other agents are not deployed
Error Flow
Prompt: "Scrape data from this SPA with Cloudflare protection"
Expected result:
- target-analyst identifies Cloudflare challenge and SPA rendering
- crawler-developer uses Playwright with appropriate wait strategies
- parser-engineer handles dynamic DOM with robust selectors
- monitor-operator sets up change detection for frequently updated selectors
Agent Extension Skills
| Skill |
Path |
Enhanced Agent |
Role |
| selector-generator |
.claude/skills/selector-generator/skill.md |
parser-engineer |
CSS/XPath selector generation, robustness scoring, change detection |
| anti-bot-analyzer |
.claude/skills/anti-bot-analyzer/skill.md |
target-analyst, crawler-developer |
Anti-bot defense layer analysis, rate limit detection, legal risk assessment |
1---2name: web-scraper3description: Full pipeline for building web scraping systems with agent team collaboration. Use this skill for requests like 'build a web scraper', 'develop a crawler', 'collect site data', 'web crawling system', 'build a scraper', 'data collection automation', 'site parsing', 'web data extraction', etc. Also supports target-analysis-only mode for specific site analysis. Note: real-time streaming data processing (Kafka/Flink), browser automation testing (Selenium testing), and website performance monitoring are outside the scope of this skill.4---56# Web Scraper — Web Scraping System Construction Pipeline78An agent team collaborates to build target analysis, crawler design, parsing, storage, and monitoring for web scraping systems.910## Execution Mode1112**Agent Team** — Five agents communicate directly via SendMessage and perform cross-validation.1314## Agent Composition1516| Agent | File | Role | Type |17|-------|------|------|------|18| target-analyst | `.claude/agents/target-analyst.md` | Target site analysis, risk assessment | general-purpose |19| crawler-developer | `.claude/agents/crawler-developer.md` | Crawler architecture and implementation | general-purpose |20| parser-engineer | `.claude/agents/parser-engineer.md` | Parsing logic design and implementation | general-purpose |21| data-manager | `.claude/agents/data-manager.md` | Data storage, validation, export | general-purpose |22| monitor-operator | `.claude/agents/monitor-operator.md` | Monitoring, alerting, scheduling | general-purpose |2324## Workflow2526### Phase 1: Preparation (performed directly by the orchestrator)27281. Extract the following from user input:29 - **Target site URL**: Website to scrape30 - **Target data**: What data to extract31 - **Purpose**: Intended use of collected data (analysis/monitoring/archiving)32 - **Scale**: Expected data volume, collection frequency33 - **Constraints** (optional): Tech stack limitations, budget, legal requirements342. Create the `_workspace/` directory at the project root353. Organize the input and save it to `_workspace/00_input.md`364. Create the `_workspace/src/` directory375. If pre-existing files are available, copy them to `_workspace/` and skip the corresponding phase386. **Determine the execution mode** based on the scope of the request (see "Execution Modes" below)3940### Phase 2: Team Assembly and Execution4142Assemble the team and assign tasks. Inter-task dependencies are as follows:4344| Order | Task | Owner | Dependencies | Deliverable |45|-------|------|-------|-------------|-------------|46| 1 | Target site analysis | analyst | None | `_workspace/01_target_analysis.md` |47| 2a | Crawler design and implementation | crawler | Task 1 | `_workspace/02_crawler_design.md` + `src/` |48| 2b | Parsing logic design and implementation | parser | Task 1 | `_workspace/03_parser_logic.md` + `src/` |49| 3 | Data storage design | data-mgr | Task 2b | `_workspace/04_data_storage.md` + `src/` |50| 4 | Monitoring configuration | monitor | Tasks 2a, 2b, 3 | `_workspace/05_monitor_config.md` + `src/` |5152Tasks 2a (crawler) and 2b (parser) run **in parallel** since both depend only on Task 1 (analysis).5354**Inter-agent communication flow:**55- analyst completes > passes URL patterns, anti-bot info, rate limits to crawler; data points and DOM structure to parser56- crawler completes > passes raw data format to parser; crawler health checkpoints to monitor57- parser completes > passes data schema to data-mgr; parsing metrics to monitor58- data-mgr completes > passes data quality metrics to monitor59- monitor integrates all components to finalize operations configuration6061### Phase 3: Integration and Final Deliverables62631. Verify all files in `_workspace/` and `_workspace/src/`642. Validate cross-deliverable consistency (analysis > crawler > parser > storage > monitoring)653. Present the final summary and execution instructions to the user6667## Execution Modes by Request Scope6869| User Request Pattern | Execution Mode | Agents Deployed |70|---------------------|---------------|----------------|71| "Build a full scraping system" | **Full pipeline** | All 5 agents |72| "Analyze target site only" | **Analysis mode** | target-analyst only |73| "Build crawler only" | **Crawler mode** | target-analyst + crawler-developer |74| "Design parser only" | **Parser mode** | target-analyst + parser-engineer |75| "Monitor existing scraper" | **Monitor mode** | monitor-operator only |7677**Reusing existing files**: If the user provides existing analysis results or crawler code, copy to `_workspace/` and skip the corresponding agent.7879## Data Transfer Protocol8081| Strategy | Method | Purpose |82|----------|--------|---------|83| File-based | `_workspace/` directory | Design documents |84| Code-based | `_workspace/src/` | Executable scraping code |85| Message-based | SendMessage | Key information transfer, feedback |8687## Error Handling8889| Error Type | Strategy |90|-----------|----------|91| Target site inaccessible | Analyze via cached/archived versions; explore alternative URLs |92| robots.txt blocks all crawling | Check for public API; propose API-based approach |93| Anti-bot blocks all requests | Escalate difficulty; propose headless browser or API alternatives |94| Dynamic rendering failure | Switch to Playwright; increase timeouts |95| Agent failure | Retry once; if still failing, proceed without that deliverable |9697## Test Scenarios9899### Normal Flow100**Prompt**: "Build a scraper to collect product prices from this e-commerce site daily"101**Expected result**:102- Analysis: Site structure, pagination, anti-bot mechanisms, robots.txt compliance plan103- Crawler: Async httpx-based crawler with rate limiting and retry logic104- Parser: CSS selector-based price/title/URL extraction with validation105- Storage: SQLite with upsert deduplication, CSV daily export106- Monitoring: Cron schedule, parsing success rate alerts, site change detection107108### Analysis-Only Flow109**Prompt**: "Analyze whether this site can be scraped"110**Expected result**:111- target-analyst performs full analysis and risk assessment112- Other agents are not deployed113114### Error Flow115**Prompt**: "Scrape data from this SPA with Cloudflare protection"116**Expected result**:117- target-analyst identifies Cloudflare challenge and SPA rendering118- crawler-developer uses Playwright with appropriate wait strategies119- parser-engineer handles dynamic DOM with robust selectors120- monitor-operator sets up change detection for frequently updated selectors121122123## Agent Extension Skills124125| Skill | Path | Enhanced Agent | Role |126|-------|------|---------------|------|127| selector-generator | `.claude/skills/selector-generator/skill.md` | parser-engineer | CSS/XPath selector generation, robustness scoring, change detection |128| anti-bot-analyzer | `.claude/skills/anti-bot-analyzer/skill.md` | target-analyst, crawler-developer | Anti-bot defense layer analysis, rate limit detection, legal risk assessment |