-def fetch(url: str, session: requests.Session, timeout: int) -> BeautifulSoup:
- with session.get(url, timeout=timeout) as r:
- r.raise_for_status()
- return BeautifulSoup(r.text, 'html.parser')
+def fetch(url: str, fetcher: Fetcher) -> BeautifulSoup:
+ return BeautifulSoup(fetcher.fetch(url), 'html.parser')