Skip to content

Instantly share code, notes, and snippets.

View GeorgeKontsevik's full-sized avatar
🎯
Focusing

George GeorgeKontsevik

🎯
Focusing
View GitHub Profile
@morrisalp
morrisalp / grequests_tqdm.py
Last active September 18, 2023 12:19
send async HTTP requests using grequests with tqdm progress bar
from tqdm import tqdm
import requests, grequests
class ProgressSession():
def __init__(self, urls):
self.pbar = tqdm(total = len(urls), desc = 'Making async requests')
self.urls = urls
def update(self, r, *args, **kwargs):
if not r.is_redirect:
self.pbar.update()