Pry Architecture π’
POST /v1/scrape βββΆ API Server (FastAPI)
β
βΌ
βββββββββββββββ miss ββββββββββββββββββββ
β Strategy ββββββββββββββΆβ Escalation chain β
β Router β β 1. plain HTTP β
βββββββββββββββ β 2. headless β
β hit β 3. solver layer β
βΌ ββββββββββββββββββββ
Result cache (Redis) β
β βΌ
βΌ Extraction pipeline
Response (readability β markdown/JSON)
Escalation chainβ
Pry always tries the cheapest option first:
- Plain HTTP with tuned headers β fastest, works on most static sites.
- Headless Chromium (Playwright) β JS rendering, session handling.
- Solver layer β challenge bypass for protected sites.
Each level reports why it failed; the router records the winning strategy per domain so repeat scrapes skip straight to what works.
Storageβ
- Redis: result cache + per-domain strategy memory + rate limits.
- Nothing is persisted by default β Pry is a proxy, not an archive. Enable the optional storage backend if you need scrape history.