How to avoid getting blocked while web scraping
A scraper gets blocked on one of four signals: a bad IP, a fast or regular rate, a bot-like fingerprint, or bot-like behaviour. Fix them in that order and most targets go back to serving 200s.

A block is feedback, not bad luck. Four signals cause almost all of them: the IP, the request rate, the fingerprint, and behaviour. Work through them in that order. The cheap fixes come first, and you stop as soon as the blocks stop.
This guide is about automation. If you only need to open a blocked page in a browser, that is a different problem — start with how to bypass website blocks, which covers DNS, VPNs, proxies, and Tor.
Fix the IP first
Address reputation sets your starting credibility before you send a header. Datacenter IPs are pre-flagged on hardened sites. Residential IPs look like home users; mobile carrier IPs sit behind carrier-grade NAT and are hard to block without collateral.
If your target is strict, the IP is the first thing to change. If it lets datacenter traffic through, save your budget.
Then slow down and vary the timing
A regular interval is itself a fingerprint. Humans do not click like a metronome. Add randomised delays, keep concurrency low, and cache pages so you never fetch the same one twice.
Then make the request look like a browser
Send a current user-agent and the headers that travel with it: Accept, Accept-Language, and a plausible Referer. Consistency matters more than any single value. A Chrome user-agent with Firefox-style headers is worse than no spoofing. TLS fingerprints sit a layer below and are covered in how to bypass website blocks.
Handle a challenge honestly
A 200 that returns a CAPTCHA or an empty shell is a block in disguise, so validate the body, not just the status code. A 429 means slow down and honour the retry header; a 403 usually means the IP or the fingerprint, not the rate.
Know when to render
Pages built by JavaScript need a real browser engine, as shown in proxies in Selenium and Playwright. Rendering costs CPU and memory, so reserve it for the pages that truly need it.
What gets a scraper blocked first?
Usually the IP. Datacenter ranges are often blocked on sight. After that, the rate and the fingerprint matter most.
Does changing the user-agent help?
It helps only if the rest of the headers match. An inconsistent set is more suspicious than a plain, honest client.
Why do I get a 200 but no data?
That is a soft block: a challenge or shell served as success. Validate the content, not just the status code, and treat it as a failure.
When should I use a browser instead of HTTP?
When the page is built by JavaScript or served behind a challenge. Otherwise plain HTTP with good headers is lighter and faster.
