diff --git a/scraper/engine.py b/scraper/engine.py index 8155fbb..2a17abb 100644 --- a/scraper/engine.py +++ b/scraper/engine.py @@ -6,7 +6,7 @@ class Engine: - def __init__(self, url, max_retries, backoff_factor) -> None: + def __init__(self, url: str, max_retries: int, backoff_factor: int) -> None: self.url = url self.request = Request(max_retries=max_retries, backoff_factor=backoff_factor) @@ -28,7 +28,7 @@ def fetch(self, content: str = None) -> pd.DataFrame: logger.info(f"Parsed content from {self.url}. Extracted {len(df)} rows.") return df - def get_content(self): + def get_content(self) -> str: try: r = self.request.request("GET", self.url) r.raise_for_status() diff --git a/utils/request_helper.py b/utils/request_helper.py index 3097fb9..8fbb15e 100644 --- a/utils/request_helper.py +++ b/utils/request_helper.py @@ -6,7 +6,7 @@ class Request: - def __init__(self, max_retries, backoff_factor) -> None: + def __init__(self, max_retries: int, backoff_factor: int) -> None: self.max_retries = max_retries self.backoff_factor = backoff_factor