From 9850fdf2b366f79386ad97c58ff76992309afc8e Mon Sep 17 00:00:00 2001 From: bitscuit Date: Sun, 9 May 2021 13:19:27 +0200 Subject: [PATCH] Added counter for number of fetched sites --- main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 653092d..3f0fb13 100644 --- a/main.py +++ b/main.py @@ -70,6 +70,7 @@ urls.put(INDEX_URL) # Create list to store visited sites visited = set([INDEX_URL]) +numFetched = 0 # Loop while not urls.empty(): @@ -85,7 +86,8 @@ while not urls.empty(): url = urls.get() # Perform request - log.info("Fetching '%s'..."%url) + log.info("Fetch %d: '%s'..."%(numFetched, url)) + numFetched += 1 try: r = session.get(url, stream=True, timeout=5) r.close()