diff --git a/compare_pages.py b/compare_pages.py index 4f8e6fe..03f458a 100755 --- a/compare_pages.py +++ b/compare_pages.py @@ -159,16 +159,16 @@ def render_teletekst(fname, content): # lives, and possibly be wrong there anyway # Wrap it in the minimally needed HTML - content = ''' + content = f''' - + -
%s
+
{content}
-''' % (content,) +''' imgkit.from_string( content, fname, diff --git a/walk_pages.py b/walk_pages.py index 02aee2c..66e8051 100755 --- a/walk_pages.py +++ b/walk_pages.py @@ -50,7 +50,10 @@ def handle_data(self, data): self.text_collected += data def error(self, message): - print(f"Parsing error: {message}") + """ + Implement abstract error() function + """ + print(f"[{self}] Parsing error: {message}") def parse_headlines(text): @@ -100,8 +103,8 @@ def fetch_page(page, http, stamp, is_index): try: page_json = json.loads(result.data) - except ValueError as e: - print(f"Error parsing JSON: {e}") + except ValueError as err: + print(f"Error parsing JSON: {err}") print(result.data) sys.exit(1)