Skip to main content
The health command tests all spiders, detects failures (extraction vs crawling), and generates a markdown report for automated fixing.

Quick Start

Output:
Workflow: Detect (5 min) → Fix (5 min) → Verify (2 min) = 12 min vs 45 min manual

How It Works

1

Runs test crawl

Crawls each spider with --limit 5
2

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

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 selectors

Fixing Broken Spiders

Example: BBC Spider Breaks

1. Health check detects failure:
2. Agent fixes it:
Agent analyzes site, finds selectors changed from 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

Check network, database, or rate limiting issues. Test single spider with verbose logging:
Caused by A/B testing, geo-restrictions, or rate limiting. Run tests multiple times or use --browser if JS rendering needed.
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 = 33,300/yearvsAgentassisted=33,300/year vs Agent-assisted = 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

Incremental Crawling

Skip unchanged pages with DeltaFetch

Queue Processing

Batch process multiple sites

Custom Callbacks

Complex extraction patterns

Cloudflare Bypass

Handle protected sites