Writing fast async HTTP requests in Python

11 · JonLuca De Caro · June 15, 2021, 5:25 a.m.
I do a lot of web scraping in my spare time, and have been chasing down different formats and code snippets to make a large amount of network requests locally, with controls for rate limiting and error handling. I’ve gone through a few generations - I’ll use this post to catalogue where I started and what I’m doing now. Gen 1 Generation one was trusty old requests. Need to make 10 requests? Wrap it in a for loop and make them iteratively. import requests results = {} for i in range(10): res...