diff --git a/py34/scraper.py b/py34/scraper.py index a4f654a..4a7054a 100644 --- a/py34/scraper.py +++ b/py34/scraper.py @@ -16,7 +16,7 @@ class CaptchaException(Exception): def __init__(self, *argv: any): # Reset scraper global scraper - scraper = Scraper() + scraper.reset() # Construct the exception super().__init__(self, *argv) @@ -44,7 +44,11 @@ class Scraper: def _retry_get(self, url: str, body: bool) -> bytes | Response: return self._get(url, body=body) + def close(self): + self._scraper.close() + def reset(self): + self._scraper.close() self._scraper = CloudScraper() def get(self, url: str, retry: bool = True, body: bool = True):