How to Rate Limit Async Requests in Python
Quick tutorial on how to limit asynchronous python connections when web scraping. This can reduce and balance out web scraping speed to avoid scraping pages too fast and blocking.
"Error 1009 Access Denied: Country or region banned" can be encountered when web scraping Cloudflare-covered websites. This generally means that website does not support the country or region of a web scraper's IP address.
For example, if a scraper is hosted on a server in the US and scraping a website located in Germany it can be easily identified and blocked based on its IP address.
Error 1009: Country or region banned - Cloudflare
To avoid this error we can use IP proxies of allowed countries or web scraping APIs such as ScrapFly. For more on IP-blocking see our introduction article: How to avoid web scraper IP blocking?