From 3ab4f893b799ec8a3965785159c21f7b12d238ae Mon Sep 17 00:00:00 2001 From: Joshua Potter Date: Sat, 9 Dec 2023 15:39:56 -0700 Subject: [PATCH] Add logging around failed network requests. --- coach_scraper/pipeline.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coach_scraper/pipeline.py b/coach_scraper/pipeline.py index e6dc8a8..6e5cd86 100644 --- a/coach_scraper/pipeline.py +++ b/coach_scraper/pipeline.py @@ -1,4 +1,5 @@ import asyncio +import logging import os.path from typing import Any, List, Tuple @@ -58,6 +59,7 @@ class Fetcher: async with self.session.get(url) as response: if response.status == 200: return await response.text(), 200 + logging.error(f"Could not fetch URL {url}. Status code: {response.status}") return None, response.status async def scrape_usernames(self, page_no: int) -> List[str] | None: