Sponsored by Decodo
How to unblock difficult targets and bypass blocking mechanisms
Here is how you bypass the most sophisticated blocking mechanisms on the web today.
If you think of web scraping as a video game, most websites would be prologues designed to help you understand the game's stakes and controls. You send a basic request and get the data. That’s all, everyone is happy.
But as you come upon major sites like Amazon or highly protected flight aggregators, things get more difficult. It’s because these look beyond your IP and peek into your browser's digital DNA. A simple IP rotation won’t get the job done here, so you need to mimic human behavior with utmost precision.
Here is how you bypass the most sophisticated blocking mechanisms on the web today.
Limited offer - 10% discount on all residential proxy plans at Decodo (formerly Smartproxy)
Use code TECHRADAR10 at checkout and save 10% on all residential proxies subscriptions. Get started from only $2/GB and experience top-tier performance with 115M+ ethically sourced IPs from 195+ worldwide locations.
1. Master headers and cookies
Every time your scraper talks to a server, it sends a header, which is a packet of metadata that tells the server who you are. If you use the default headers of a library like Python’s Requests, you’re essentially holding a big, glowing sign that says "I am a bot”.
To bypass blocks, you have to use real-world browser headers from Chrome, Safari, Firefox, and others. They offer far more context and security to the server because they are built to facilitate a rich web experience. On the other hand, default headers (those sent by tools like curl or automated libraries) are minimal and may reveal the request as non-human, leading to blocking.
Hence, real-world headers such as User-Agent (shows the site the browser you’re using, its version, and the operating system), Accept-Language (sets the preferred language), Accept-Encoding (indicates the compression algorithm the sender can understand), and Referer (tells the website which URL the request came from) are a must. In case these don't match or look a bit off, the site will hit you with a CAPTCHA.
Similarly, you need to handle cookies with a delicate touch. Since they act as a website’s short-term memory, you must prove you’ve actually navigated the site instead of just teleporting straight to a data-heavy page.
For tougher targets, the idea is to manage these cookies to maintain a persistent session, basically tricking the server into believing you're a returning user who already passed initial security checks. If you reject all cookies or fail to pass them back correctly, you look like a script that hasn't cleared its cache in years, which is an immediate red flag.
Certain web data access and scraping platforms, including some of the specialized APIs from Decodo, manage these headers for you, rotating them so that every request looks like it’s coming from a unique, optimally configured browser.
2. Learn proper session management
A session is the time a user spends on a website. For difficult targets, you can’t just parachute your way in, grab whatever piece of data you need, and vanish. Here, it’s smart to adopt a sales approach and warm up the connection. Just like nurturing potential customers, it might involve visiting the homepage first, waiting a few seconds, visiting another page, and then moving to the search page.
In that regard, session management involves keeping track of cookies and IDs across multiple requests. If you’re scraping a site that requires a login, maintaining that session without triggering an alert due to suspicious behavior is a fine art. It requires a balance of not clicking too fast while being consistent. In the event your IP changes mid-session but your cookies stay the same, some security systems will flag you.
Hence, using a provider that offers sticky sessions (the same IP remains across multiple requests for a set period) ensures your IP stays put just long enough to finish the job.
3. Utilize headless browser support
Sometimes, a website’s security is so tight that it will only show content to a real browser. This is where headless browsers (like Playwright, Selenium, Puppeteer, and Cypress) come in.
A headless browser is a web browser without a graphical user interface that runs in the background and does all the things your Chromes and Safaris do. From executing JavaScript to handling network requests and everything in between, they perform these actions without displaying a window, but pass all the background checks the website throws at them.
Now, these browsers are generally considered resource-efficient because they lack the GUI part. As such, they use notably less CPU and memory, which is why they’re great for web scraping and automated testing.
The downside is no visual feedback, meaning debugging UI-related issues is next to impossible. Also, headless browsers may miss certain nuances in dynamic page elements in terms of how they appear or function. Still, they are often successful in circumventing browser fingerprinting and can convincingly simulate mouse movements, scrolls, random pauses, and other details of a (bored) human browsing.
4. Factor in JavaScript rendering
Chances are, you’ve visited a site that stays blank for a second while loading. That’s JavaScript rendering in action. This ties to the fact that many modern websites are single-page applications that load a single HTML page and dynamically update content as the user interacts with them. The actual data is fetched and presented on the screen by JavaScript after the page loads, thus avoiding full-page reloads.
However, in case your scraper only reads the initial HTML, you’ll end up with a page full of nothing. To bypass this, your scraping setup must be able to execute JavaScript. This is standard in headless browsers, but it’s quite a hurdle for simpler scripts.
Many devs now offload this to scraping APIs that handle the rendering on their own servers, sending back the finished HTML. Some platforms offer JS rendering as a core feature, allowing you to get the data from a React or Angular site as easily as a plain text page.
5. Transition to advanced scraping solutions
At a certain point, the game (or art, if you prefer) of unblocking becomes a full-time gig. You fix your headers, but the detection logic changes. You fix your JS rendering, now there’s a new type of CAPTCHA.
So, you’ll likely need more firepower. Luckily, some solutions sit right between your script and the target website. Instead of managing your own headless browser farm or manually solving human verification tests, you send the URL to the API. The advanced part of the solution handles the proxy rotation, header management, JS rendering, and the retry logic automatically.
In other words, opting for a platform like Decodo for these difficult targets passes on the heavy lifting to someone else. For instance, its Site Unblocker technology is designed specifically for those boss-level sites, using AI to figure out the best way to bypass a specific site's defense mechanisms in real time.
Mind you, as AI-driven security slowly becomes the norm, any help will be rather welcome when scraping the web and figuring out the ins and outs of the entire browser environment.
Sign up to the TechRadar Pro newsletter to get all the top news, opinion, features and guidance your business needs to succeed!
Sead is a seasoned freelance journalist based in Sarajevo, Bosnia and Herzegovina. He writes about IT (cloud, IoT, 5G, VPN) and cybersecurity (ransomware, data breaches, laws and regulations). In his career, spanning more than a decade, he’s written for numerous media outlets, including Al Jazeera Balkans. He’s also held several modules on content writing for Represent Communications.
