Web scraping - what is HTTP 520 status code?

Response status code 520 generally means the server failed to generate a valid response (Often related to Cloudflare). This could be caused by technical issues however in web scraping this can also mean insufficient request details or web scraper blocking.

To avoid status code 520 when web scraping ensure that sent requests contain all required headers like secret/CSRF tokens, Origin, Referer and other commonly required details. If it's a POST request make sure the sent body matches expected format.

Otherwise, it's possible the scraper is being identified and blocked. For that refer to our how to scrape without being blocked guide which covers all of the ways to prevent web scrapers from being identified.

Question tagged: Scraper Blocking

Related Posts

How to Know What Anti-Bot Service a Website is Using?

In this article we'll take a look at two popular tools: WhatWaf and Wafw00f which can identify what WAF service is used.

Use Curl Impersonate to scrape as Chrome or Firefox

Learn how to prevent TLS fingerprinting by impersonating normal web browser configurations. We'll start by explaining what the Curl Impersonate is, how it works, how to install and use it. Finally, we'll explore using it with Python to avoid web scraping blocking.

FlareSolverr Guide: Bypass Cloudflare While Scraping

In this article, we'll explore the FlareSolverr tool and how to use it to get around Cloudflare while scraping. We'll start by explaining what FlareSolverr is, how it works, how to install and use it. Let's get started!