Guides

Stealth (anti-bot)

Impersonate a real browser's TLS fingerprint to get past anti-bot filters, without a headless browser.

Many anti-bot systems block a plain HTTP client by its TLS/JA3 fingerprint before serving any content — no proxy or browser will help if the handshake itself is flagged. Set impersonate to mimic a real browser's fingerprint and get past that class of block.

from pyscrappy import ScraperConfig, GenericScraper
 
# needs the optional extra:  pip install 'pyscrappy[stealth]'
config = ScraperConfig(impersonate="chrome")   # or "chrome124", "safari", "firefox"
 
with GenericScraper(config) as gs:
    result = gs.scrape("https://example.com")

Notes

  • Requires the optional curl_cffi backend: pip install 'pyscrappy[stealth]'. If it isn't installed, a clear error points you there.
  • Impersonation currently applies to the synchronous path only; setting it on an async client raises an explicit error rather than silently ignoring it.
  • All the usual retry, rate-limiting, caching, and robots handling still apply — impersonation only changes how the underlying request is made.

When to reach for it

Stealth, proxies, and scraping-API services solve different layers of the same problem:

  • impersonate — the site blocks by TLS fingerprint. Cheapest fix; no proxy, no browser.
  • Proxy / rotating proxies — the site blocks or rate-limits by IP.
  • Scraping-API service — the site needs full anti-bot challenge solving.

They compose: you can use a proxy and impersonate together.