X-Git-Url: http://git.scottworley.com/paperdoorknob/blobdiff_plain/4c1cf54e0fa588eda9ebee0aa48d1b56c0c3a37f..136277e30143cd1219c896bb4980027ac3c6dbe1:/paperdoorknob.py?ds=sidebyside diff --git a/paperdoorknob.py b/paperdoorknob.py index b7e4349..bb8bdd1 100644 --- a/paperdoorknob.py +++ b/paperdoorknob.py @@ -7,6 +7,7 @@ from argparse import ArgumentParser import os.path +from bs4 import BeautifulSoup import requests import requests_cache from xdg_base_dirs import xdg_cache_home @@ -27,9 +28,10 @@ def command_line_parser() -> ArgumentParser: return parser -def fetch(url: str, session: requests.Session, timeout: int) -> None: +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 main() -> None: