Prompt
I'm building a scraper that needs proxy rotation and session persistence; what tool stack makes sense?
Latest observation
Oct 26, 2026
OpenAI APIWeb search: off
A solid stack for proxy rotation + session persistence usually looks like this:
1) HTTP client / browser automation
Pick based on target complexity:
- Simple pages / APIs:
- Python:
httpxorrequests - Node.js:
undicioraxios
- Python:
- JS-heavy / anti-bot / login flows:
- Playwright is usually the best default
- Puppeteer if you already use it
2) Session persistence
You need to preserve cookies, headers, local storage, and sometimes fingerprints.
- Playwright persistent context
Best option for browser-based scraping.- Saves cookies/localStorage in a user data dir
- Easy to reopen sessions across runs
- Cookie jar / session store for HTTP clients
- Python:
httpx.Cookies,requests.Session, orMozillaCookieJar - Node: maintain cookies via a jar library like
tough-cookie
- Python:
If you need robust persistence across processes, store:
- cookies
- auth tokens
- proxy assigned to that session
- user-agent / client hints
- any site-specific state
Use Redis or a DB (Postgres/SQLite) for this.
3) Proxy rotation
You have a few common patterns:
- Per-request rotation
Good for stateless scraping, but bad for login/session flows. - Sticky sessions per target account / browser profile
Better for logged-in or stateful crawling.- Keep the same proxy for a session for a TTL window
- Pool with health checks
Track success rate, latency, ban rate, and rotate bad proxies out
Typical proxy options:
- residential proxies
- datacenter proxies
- mobile proxies for tougher sites
4) Orchestration / queue
For scale and reliability:
- Celery + Redis/RabbitMQ in Python
- BullMQ + Redis in Node.js
- or a simpler job queue if you’re small-scale
5) Storage / state
- Redis: fast session/proxy mapping, TTLs, locks
- Postgres: durable crawl state, proxy history, account/session metadata
- SQLite: fine for small single-machine setups
6) Recommended stacks by use case
Best general-purpose stack
- Playwright
- Redis
- Postgres
- proxy provider with sticky sessions
- custom session manager
Python API scraping stack
- httpx
requests-style cookie/session handling- Redis
- proxy pool manager
- Celery if distributed
High-complexity browser scraping stack
- Playwright
- persistent browser contexts
- Redis for session/proxy assignment
- Postgres for durable state
- queue/worker architecture
7) Key design rule
If you need session persistence, don’t rotate proxies randomly every request.
Instead:
- assign a sticky proxy per session
- persist that mapping
- rotate only when the session expires, fails, or gets flagged
A practical “good default”
If you’re starting from scratch, I’d suggest:
- Playwright
- Redis for session + proxy mapping
- Postgres for long-term state
- Sticky proxies from a provider
- Worker queue like BullMQ or Celery
If you want, I can sketch a concrete architecture for Python or Node.js with session/proxy management patterns and example code.