health command tests all spiders, detects failures (extraction vs crawling), and generates a markdown report for automated fixing.
Quick Start
How It Works
1
Runs test crawl
Crawls each spider with
--limit 52
Checks crawling
Pass if 3+ items found, fail if less (crawling broken)
3
Checks extraction
Pass if content ≥ 50 chars, fail if too short (extraction broken)
4
Generates report
Markdown file with failure details and sample output
Two Failure Modes
- Extraction Broken
- Crawling Broken
Symptoms: Finds articles but extracts empty/incomplete fieldsCause: CSS selectors changed (e.g.,
.article-content → .article-body)Report shows: Items found, content too short, test URL, sample outputFix: Update extraction selectorsFixing Broken Spiders
Example: BBC Spider Breaks
1. Health check detects failure:article[data-component="text-block"] to [data-component="article-body"] p, and updates config.
3. Verify:
Automated Testing
Cron Setup
Notifications
Command Options
Exit codes: 0 = all passed, 1 = failures detected
Best Practices
- Monthly testing for most spiders
- Weekly testing for critical sources
- Adjust thresholds per content type (
--min-content-length) - Keep reports for trend analysis
- Batch fixes when multiple spiders break
Troubleshooting
All Tests Failing
All Tests Failing
Check network, database, or rate limiting issues. Test single spider with verbose logging:
Intermittent Failures
Intermittent Failures
Caused by A/B testing, geo-restrictions, or rate limiting. Run tests multiple times or use
--browser if JS rendering needed.Agent Can't Fix
Agent Can't Fix
Site fundamentally changed (static → JS-rendered, paywall, anti-scraping). Try browser mode, manual inspection, or reconsider viability.
Economics
Time savings at scale:
Cost (100 spiders): Manual = 9,500/year (including $800 in tokens)
Assumes 4 breaks/spider/year, 45 min manual fix, 10 min agent-assisted fix, $100/hr developer cost
Related Guides
Incremental Crawling
Skip unchanged pages with DeltaFetch
Queue Processing
Batch process multiple sites
Custom Callbacks
Complex extraction patterns
Cloudflare Bypass
Handle protected sites