This commit is contained in:
Kovid Goyal 2025-04-27 20:29:14 +05:30
parent a7285b7c88
commit b75ad343fb
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1,7 +1,6 @@
#!/usr/bin/env python
# vim:fileencoding=utf-8
import re
from datetime import datetime, timezone
from mechanize import Request
@ -321,7 +320,7 @@ class Fokus(BasicNewsRecipe):
return feeds
def postprocess_html(self, soup, _, read_more_regex: re.Pattern = re.compile("^Läs även:")):
def postprocess_html(self, soup, _, read_more_regex: re.Pattern = re.compile(r'^Läs även:')):
# When scraped, Fokus sometimes returns a duplicate of the article, i.e., the exact same article concatenated
# to itself. To avoid duplication in the output file, remove all <div> tags after the <p> tag whose content is
# "***" (the Fokus indication of the end of the article). "***" is sometimes followed by one or multiple