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.
Response status code 403 is denial of content status code which means the client is forbidden from seeing this content for one reason or another by the server.
In web scraping, this can be caused by invalid request parameters: make sure the request is not missing any headers like secret/CSRF tokens or required session cookies.
Alternatively, the scraper could be identified as a web scraper and 403 can mean the scraper is simply being blocked. To prevent scrapers from being identified and blocked see our complete how to scrape without being blocked guide that covers technologies used in identifying web scrapers and how to fortify against them.
Repeated 403 status codes can lead to a complete scraper block, so these errors should be addressed ASAP.