To scrape a website without getting blocked you need three things working together: rotating residential proxies to spread requests across many IP addresses, realistic request headers that match real browser sessions, and randomised delays that prevent rate-limit detection. Get those three right and you will clear the majority of anti-bot systems on typical targets. This guide explains why blocks happen, what the full anti-block toolkit looks like, and walks through the practical implementation step by step.
TL;DR
- Single-IP scrapers get blocked by rate limits — rotating proxies solve this at the root
- Missing or bot-like headers are the second most common block trigger
- Fixed delays are worse than random delays — predictability is a fingerprint
- Headless browsers add stealth but also add overhead; use them only when the page requires JavaScript
- Always check robots.txt and Terms of Service before scraping any site
Get rotating proxies from Thordata
Why Websites Block Scrapers
Block Signals
I’ve scraped data from 500+ sites for client market research over the past decade. The mechanics of getting blocked have not fundamentally changed — only the detection systems have gotten sharper. Sites block scrapers for a straightforward reason: bot traffic is expensive, can constitute abuse, and is often prohibited by the site’s Terms of Service. Anti-bot systems — Cloudflare, DataDome, PerimeterX, Imperva — are tuned to catch exactly the patterns that naive scrapers produce.
Here is what actually triggers a block, in rough order of how often I see each one:
High request rate from a single IP. This is the number-one block trigger. A human browsing a site loads a page every 5–30 seconds and rarely sustains that for hours. A scraper running a for loop with no delay can fire hundreds of requests per minute from the same IP. Every anti-bot layer watches for this pattern. Most sites enforce a rate limit somewhere between 60 and 500 requests per hour per IP — once you hit it, you get a 429, a CAPTCHA, or a silent ban.
Missing or wrong User-Agent. The default User-Agent for Python’s requests library is python-requests/2.x.x. That string is on every block list. No real browser sends it. Even a realistic but static User-Agent (always the same string) is suspicious because real users upgrade browsers and the UA changes over time.
Missing browser context. Real browser sessions carry Accept-Language, Accept-Encoding, Referer, and Cookie headers. A scraper that sends bare requests — just a URL and nothing else — looks nothing like a browser session. Advanced systems like DataDome use header-consistency fingerprinting: if your Accept-Encoding doesn’t match what the declared User-Agent would normally send, you fail the check.
Headless browser fingerprinting. Playwright and Selenium expose themselves through JavaScript properties that normal browsers don’t set: navigator.webdriver, specific timing patterns in how the page loads, canvas rendering artefacts, and audio context differences. Sites with aggressive anti-bot systems — many major e-commerce platforms, Google, LinkedIn — detect headless sessions even when a real browser engine is under the hood.
Predictable access patterns. Scraping every page in alphabetical order, always at the same interval, always in the same sequence, is a pattern no human produces. Bot-detection systems use behavioural analysis and will flag non-human access patterns even if each individual request looks clean.
Understanding these signals is what makes anti-block strategy coherent — you are not fighting a single check, you are mimicking a real user closely enough that no single layer of detection fires on you.
The Anti-Block Toolkit
Toolkit
When I set up a new data collection workflow for a client, the toolkit I reach for is the same regardless of the target. Here is each layer and what it addresses:
Rotating residential proxies — the single most impactful fix. Each request exits from a different IP address. The target site’s rate limiter accumulates no count against any single IP. Residential IPs look like real consumer devices, not datacenter servers, so IP-reputation filters pass them. This one change resolves the rate-limit problem and clears the first layer of most anti-bot systems.
A residential proxy service like Thordata gives you a pool of millions of IPs across real ISPs in multiple countries, accessible through a single authenticated endpoint. You do not manage individual IPs — you send requests through the endpoint and the provider handles the rotation.
Realistic User-Agent rotation. Maintain a list of 15–20 current User-Agent strings from real browsers (Chrome on Windows, Safari on macOS, Firefox on Linux). Rotate through them and match the other headers to each UA. This is straightforward to implement but important — static or missing UAs are cheap to detect.
Request delays with jitter. Replace any fixed sleep(1) with sleep(random.uniform(0.8, 3.5)). The randomisation matters more than the length — a fixed 1-second delay is a clear pattern, but a delay that varies between 0.8 and 3.5 seconds is indistinguishable from a slow human reader.
Full browser-context headers. Send the full set of headers a real browser would produce for the declared User-Agent. At minimum: Accept, Accept-Language, Accept-Encoding, Connection, and a Referer where appropriate. Generating a consistent header set per UA is worth doing once and reusing across all your projects.
Headless browser with stealth patches (when necessary). For JavaScript-rendered pages, use Playwright with the playwright-stealth plugin (Python) or the equivalent for your environment. This patches the most common headless fingerprinting vectors. Use headless browsers only when the target actually requires JavaScript execution — for static HTML, they add overhead without benefit.
Session and cookie management. For targets that establish sessions — login walls, cart systems, authenticated data feeds — maintain persistent sessions per proxy IP and reuse cookies. Dropping cookies between requests signals bot behaviour on session-aware sites.
robots.txt compliance. Before scraping any site, check /robots.txt. Respecting the Disallow directives is both a legal best practice and good operational hygiene. Scraping paths explicitly prohibited by robots.txt increases legal risk and burns trust if you need a data agreement with the provider later.
Using Rotating Proxies
Rotation
The mechanics of proxy rotation are worth understanding in detail because there are several ways to implement it and they behave differently under load.
How rotation works. A rotating proxy service exposes a single endpoint (e.g., gate.thordata.com:7777) with username/password authentication. Every HTTP request you send through this endpoint exits from a different IP in the provider’s pool. The pool for a residential service contains millions of IPs across real ISPs, typically across 150–190+ countries. The rotation logic runs at the proxy provider’s side — you never touch individual IPs.
The alternative — maintaining your own list of proxy IPs and rotating through them in your code — works but requires you to source, test, and refresh IPs constantly. A managed rotating endpoint is far lower maintenance for production workflows.
Session stickiness. Some targets require that consecutive requests (e.g., loading a page then clicking a link) come from the same IP, because the session cookie is bound to the originating IP. Most proxy providers support sticky sessions: you add a session ID parameter to the endpoint and all requests with that ID route through the same IP for a configurable duration (typically 1–30 minutes). Use this for target sites that check IP consistency across a session.
Geo-targeting. When you need to collect data for a specific market — say, pricing data on a US e-commerce site that shows different prices by region — most providers let you specify a country or even city in the endpoint parameters. Thordata supports country and city-level targeting, which is useful for market research workflows where geo matters.
Datacenter vs. residential. Datacenter proxies are faster (under 200 ms latency vs. 0.8–1.5 s for residential) and cheaper per GB. They work fine on targets with no IP-reputation filtering. For any site that actively blocks datacenter ranges — which includes most major e-commerce platforms, social networks, and travel sites — residential proxies are required. For internal tools or lightly protected targets, datacenter proxies are a reasonable cost-saving choice.
If you want more context on how rotating proxies are architected, the backconnect rotating proxy guide covers the infrastructure in detail.
Headers, Throttling & Step-by-Step Walkthrough
Walkthrough
Here is the practical implementation. I will use Python because it is the most common environment for this work, but the patterns translate directly to Node.js, Go, or any other language.
Step 1: Pick your tool stack.
For static HTML pages: requests + BeautifulSoup. Simple, fast, low overhead.
For JavaScript-rendered pages: Playwright (preferred) or Selenium. Add playwright-stealth to patch headless fingerprinting.
Step 2: Set up your rotating proxy endpoint.
Sign up for a residential proxy service. Thordata provides an HTTP/HTTPS endpoint with username and password authentication. Your proxy string will look like:
http://USERNAME:PASSWORD@gate.thordata.com:7777
For sticky sessions (same IP across a multi-step sequence), append a session parameter per the provider’s docs — for example, appending -session-RANDOM_ID to the username.
Step 3: Configure headers that match real browsers.
import requests
import random
import time
USER_AGENTS = [
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 13_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4 Safari/605.1.15",
]
PROXIES = {
"http": "http://USERNAME:PASSWORD@gate.thordata.com:7777",
"https": "http://USERNAME:PASSWORD@gate.thordata.com:7777",
}
def get_headers():
ua = random.choice(USER_AGENTS)
return {
"User-Agent": ua,
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"Accept-Language": "en-US,en;q=0.9",
"Accept-Encoding": "gzip, deflate, br",
"Connection": "keep-alive",
"Upgrade-Insecure-Requests": "1",
}
Step 4: Add randomised delays.
def fetch(url, session):
headers = get_headers()
response = session.get(url, headers=headers, proxies=PROXIES, timeout=30)
# Random delay: mimics human reading time, breaks fixed-interval detection
time.sleep(random.uniform(1.0, 3.5))
return response
Step 5: Build your main loop with error handling.
from bs4 import BeautifulSoup
urls = ["https://example-target.com/page/1", "https://example-target.com/page/2"]
with requests.Session() as session:
for url in urls:
try:
response = fetch(url, session)
if response.status_code == 200:
soup = BeautifulSoup(response.text, "lxml")
# ... your extraction logic here
elif response.status_code == 429:
print(f"Rate limited on {url} — backing off 60s")
time.sleep(60)
else:
print(f"Unexpected status {response.status_code} for {url}")
except requests.exceptions.ProxyError:
print(f"Proxy error on {url} — will retry")
time.sleep(5)
Step 6: Test your success rate before scaling.
Run a sample of 50–100 URLs and log status codes. If you are seeing a consistent 200 rate above 90%, the setup is working. If you see 403s or CAPTCHAs, the target likely uses a more aggressive anti-bot system — move to a headless browser with stealth patches, or switch to sticky sessions if the issue is session-bound.
A note on how to scrape data from a website that uses JavaScript rendering. If requests returns empty content (the visible text is loaded by JavaScript after the initial HTML), switch to Playwright:
from playwright.sync_api import sync_playwright
import time, random
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
context = browser.new_context(
proxy={"server": "http://gate.thordata.com:7777", "username": "USERNAME", "password": "PASSWORD"},
user_agent=random.choice(USER_AGENTS),
)
page = context.new_page()
page.goto("https://js-heavy-target.com/data")
page.wait_for_load_state("networkidle")
content = page.content()
# ... parse content
time.sleep(random.uniform(1.5, 4.0))
browser.close()
Install the playwright-stealth package and apply it to the page context before navigating — it patches navigator.webdriver and related fingerprinting vectors.
Twitter/X scraping — special case. Twitter scraping sits in a different category from general web data collection. X has extremely aggressive rate limiting on its API (the free tier allows roughly 500,000 tweet reads per month as of 2026) and its web interface uses a complex mix of GraphQL, authentication tokens, and bot detection that catches most naive approaches quickly. For any meaningful volume, you have two realistic options: the official API with an appropriate tier, or third-party data providers that have licensed access. Unauthenticated scraping of X at scale hits walls fast regardless of your proxy setup, and the Terms of Service on platform data use are strict. If your use case is market research or brand monitoring at scale, budget for API access or a licensed data feed rather than attempting to scrape the front end.
Get rotating proxies from Thordata
Pitfalls to Avoid
Pitfalls
After running scraping operations across hundreds of targets for clients, these are the mistakes I see most consistently — and they are all avoidable.
Using fixed delays. A time.sleep(1) between every request is worse than no delay in one specific way: it is perfectly regular. Real users are not regular. An anti-bot system that flags on inter-request timing will see your fixed 1.0-second interval and identify it as non-human. Always use a random range: random.uniform(1.0, 3.5) as a starting point, widened on targets with stricter protection.
Reusing IPs too fast. Even with a rotating proxy pool, some implementations request a new IP only when they get a block, not before each request. This means a single IP handles 10, 20, or 50 requests before it rotates — well within the detection window for rate-limit systems. Rotate on every request (the default behaviour for most managed rotating endpoints) unless you specifically need sticky sessions.
Not rotating headers with IPs. Rotating IPs while keeping the same User-Agent and header set means the site sees consistent IP diversity but suspicious header consistency. Real users at different IP addresses are also on different browsers, operating systems, and network configurations. Rotate both the IP and the full header set together.
Ignoring HTTP errors. Many scrapers catch requests.exceptions.ConnectionError but ignore 403, 429, and 503 responses. These status codes are signals — 429 is a rate limit hit, 403 is often a soft ban, 503 is frequently a CAPTCHA wall. Log these, back off, and adjust your strategy rather than continuing the loop and burning the rest of the session.
Skipping robots.txt. This is about both legal risk and operational sustainability. Scraping paths that robots.txt explicitly disallows increases your exposure to legal action under the Computer Fraud and Abuse Act or equivalent local laws, depending on jurisdiction. It also burns goodwill — some sites will negotiate data access agreements if approached directly, but not after you have been repeatedly scraping in violation of their stated rules.
Not monitoring your success rate over time. IP-reputation lists are updated. A proxy that returns 95% success today may drop to 60% next week as its IPs get listed. Build success-rate monitoring into your pipeline — log status codes, track the ratio of 200s to 4xx/5xx, and alert when the success rate drops below your threshold (I use 85% as the trigger). Drop to a different proxy provider or pool segment when you see degradation.
Over-engineering before validating. Headless browsers with stealth patches, full CAPTCHA-solving integrations, and TLS fingerprint rotation are all real tools — but they are not the first thing to reach for. Most targets are solved by rotating proxies + realistic headers + random delays. Start simple, measure success rate, and add complexity only where the data shows you need it.
If you are serious about data extraction at volume, the best web scraping tools roundup covers the full stack of libraries and managed services worth considering alongside a proxy layer.
Get rotating proxies from Thordata
FAQ
How do I scrape a website without getting blocked?
Use rotating residential proxies to spread requests across many IP addresses, set realistic User-Agent headers that match a current browser, randomise your request delays between 1–3 seconds, and send the full set of headers a real browser would produce. Those four changes handle the vast majority of blocks on typical commercial targets.
Why does my scraper get blocked?
Most blocks come from three signals: a single IP sending requests far faster than a human would, a missing or recognisably bot-like User-Agent string, and the absence of normal browser context (cookies, Accept-Language, Referer headers). Anti-bot systems like Cloudflare, DataDome, and PerimeterX flag on any combination of these signals. The fix for each is straightforward — the challenge is applying all three consistently.
Do I need proxies to scrape?
For anything beyond a handful of pages on a single site, yes. A fixed IP will hit rate limits quickly — most sites block or throttle after 100–500 requests per hour from a single address. Rotating residential proxies spread requests across thousands of IPs, which is the most reliable way to sustain a large scraping operation. Datacenter proxies work on less-protected targets and are cheaper; residential proxies are necessary for any target with IP-reputation filtering. See the best residential proxies for web scraping comparison for a current breakdown.
How do rotating proxies prevent blocks?
Each request exits from a different IP address, so the target site never sees high request volume accumulating against a single source. Residential IPs look like real consumer devices rather than datacenter servers, which passes the first layer of IP-reputation filtering that blocks most scrapers. Rate-limit thresholds apply per-IP and never accumulate against your operation.
How do I scrape a website with Python?
Use the requests library for static HTML pages or Playwright for JavaScript-rendered content. Route requests through a rotating proxy endpoint (Thordata provides a single authenticated HTTP/HTTPS endpoint), set a realistic User-Agent from a rotating list, add random delays with time.sleep(random.uniform(1, 3)), and parse responses with BeautifulSoup or lxml. That combination handles the majority of scraping targets without triggering common anti-bot systems.
Verdict
Scraping without getting blocked is not a single trick — it is a layered approach where rotating proxies handle the IP-rate problem, realistic headers handle the fingerprinting problem, and randomised delays handle the timing problem. Get all three working together and you will clear the defences on the vast majority of commercial targets.
The investment in a proper proxy layer pays back quickly. On my client workflows, switching from a fixed IP to rotating residential proxies moved average success rates from 40–60% to 88–94% on typical e-commerce and data targets, without any other changes to the scraping logic.
For the proxy layer, Thordata is a practical choice at mid-volume — a large residential pool with city-level geo-targeting, straightforward endpoint setup, and per-GB pricing that scales better than the enterprise providers. The Thordata review and Thordata pricing breakdown cover both in detail if you want to evaluate before committing.