Skip to content
web scrapingproxiesIP bans

How to Avoid IP Bans When Web Scraping (2026)

A block is usually more than the IP. Check headers, timing, retries, and whether the session has to stay on one address.

Most people change the proxy and leave the rest of the request alone. A target can still refuse the call because the header set does not match the browser it claims to be, because every request arrives on the same interval, because a 429 is treated like a 403, or because a login changed address halfway through. Fix the layer the target is actually checking. ProxyLabs does not publish a share of blocks for any one layer.

What to check, in order

CheckWhat a mismatch looks like
Proxy typeA datacenter ASN on a site that only accepts household or carrier addresses
HeadersUser-Agent says Chrome, and Sec-Ch-Ua is missing
TimingEvery request is the same number of milliseconds apart
RetriesA 429 rotates to a new address instead of waiting
SessionA login, cart, or queue token moves to a new address mid-flow

If the header set says python-requests/2.31.0, a site with ordinary bot detection does not need to look at the IP. If the IP is clean and the gap between requests never changes, a behavioral check still has a pattern to score.

Headers

The default requests library announces itself explicitly: User-Agent: python-requests/2.31.0. That's an instant block on any site with basic bot detection.

Beyond User-Agent, modern anti-bot checks header consistency. Chrome 131 always sends Sec-Ch-Ua. If your UA claims Chrome 131 but Sec-Ch-Ua is missing, the mismatch is flagged — Chrome never omits this header. The same applies to Sec-Fetch-Dest, Sec-Fetch-Mode, and Sec-Fetch-Site.

Wrong headers are enough to get blocked on their own. Send the header set a current Chrome build sends, in that order, and match the language to the country in the username. ProxyLabs does not publish a success rate for a header set.

Timing

Real users browse unpredictably. They read, get distracted, open other tabs. Your scraper does exactly 2 requests per second for 6 hours straight — a pattern that anti-bot behavioral models detect in seconds.

The fix isn't slowing down uniformly. It's adding variance. A Gaussian distribution centered on your target interval with appropriate standard deviation:

python
import time, random

def human_delay(mean=4.0, std=2.0):
    delay = max(0.5, random.gauss(mean, std))
    # Occasional longer pause — 8% chance, simulates distraction
    if random.random() < 0.08:
        delay += random.uniform(15, 60)
    time.sleep(delay)

Count blocks before and after you change only the delay. ProxyLabs does not publish a reduction for this function.

Retry logic

The most expensive mistake in scraping is treating 403 and 429 identically. They are opposite situations:

  • 403: Your IP is flagged. Rotating and retrying is correct.
  • 429: You're rate-limited but the IP is fine. Rotating and retrying just burns a clean IP for no benefit.

Rotating on a 429 spends a fresh address on a limit that belonged to the previous one. Waiting spends the time the response already asked for. Compare the bytes you pay for on the same job both ways. ProxyLabs does not publish a multiplier for that difference.

python
def smart_retry(url, proxies, max_attempts=3):
    for attempt in range(max_attempts):
        r = requests.get(url, proxies=proxies, headers=get_headers(), timeout=30)
        if r.status_code == 200:
            return r
        elif r.status_code == 403:
            proxies = new_session()          # IP flagged — rotate
            time.sleep(10 * (attempt + 1))
        elif r.status_code == 429:
            wait = int(r.headers.get('Retry-After', 60))
            time.sleep(wait)                 # Rate limited — same IP, just wait
        elif r.status_code >= 500:
            time.sleep(2 ** attempt)         # Server error — brief wait, same IP
    return None

Session Type: The Guaranteed Failure Mode

Rotating proxies on stateful workflows don't have a "lower success rate." They have a mathematically guaranteed failure mode.

When you log in, the server often ties your session to the IP that authenticated. If the IP changes mid-session — between login and cart, or between cart and checkout — the server detects an impossible transition and terminates the session.

Queue-it ties the queue token to the IP that entered. Change the IP and the token no longer matches, so the session goes back to the start. A rotating proxy does that by design. Hold the address with a sticky session for the whole wait.

WorkflowRotatingSticky
Independent page scrapingFitsFits
Login, then more pages on the accountBreaks the loginHolds the IP
CheckoutOften breaks the cartHolds the IP
Queue-itInvalidates the tokenHolds the IP you entered with
A logged-in social accountBreaks the sessionHolds the IP

On a ProxyLabs residential plan the sticky lengths are 10, 30, 60, or 120 minutes, written as -ttl- 600, 1800, 3600, or 7200. The clock starts when the session starts. Reusing the session id does not add time. us, ca, mx, br, ar, co, cl, and pe use us.proxylabs.app:8080. Every other country uses eu.proxylabs.app:8080. The username order is in how to connect. An address that has to stay tomorrow is a dedicated ISP proxy, not a longer sticky session.

The full pre-launch checklist

CheckWhy it matters
UA claims Chrome 131 → send Sec-Ch-UaChrome always sends it; missing = flag
UA consistent per session, not per requestNo real browser changes UA mid-session
Delays randomized, not uniformBehavioral ML detects constant intervals
403 → new session; 429 → same IP + waitWrong handling burns IPs or wastes time
Stateful flows use sticky sessionsIP change mid-checkout = rejected order
JS-heavy pages use Playwrightrequests returns empty shells for SPAs
Success rate tracked from request 1Can't diagnose what you don't measure

Useful guide? Share it with your team.

Share
← Back to all articlesBack to top ↑
All articles ↗
proxies

Rotating vs Sticky Proxies: When to Use Each

Sticky vs rotating proxies: a new address on each request, or the same address for 10, 30, 60, or 120 minutes. When to use each on ProxyLabs.

8 min read
python

Web Scraping with Python Requests and Proxies: Complete Guide

How to configure proxies in Python's requests library, handle authentication, rotate IPs, manage sessions, and avoid the most common mistakes that get you blocked.

8 min read
web scraping

The 8-Layer Anti-Detection Stack: How to Scrape Without Getting Blocked

Anti-detection is not one thing — it's 8 stacked systems. Pass 7 and fail 1 and you're still a bot. Here's exactly what each layer checks, when it runs, and how to address it.

6 min read