X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=Robots%2Fparse_html_beautifulsoup.py;h=130b20a7ca8f53a472526125be0390b029251c78;hb=efa27458378a9a253f0002fd060e2f8a2ae5a25f;hp=e0129fd1d4cb3c7b34f69f8c772946c04afab645;hpb=66ef97e93d66c741926db216c29dad6047c5d7f4;p=bookmarks_db.git diff --git a/Robots/parse_html_beautifulsoup.py b/Robots/parse_html_beautifulsoup.py index e0129fd..130b20a 100644 --- a/Robots/parse_html_beautifulsoup.py +++ b/Robots/parse_html_beautifulsoup.py @@ -23,9 +23,9 @@ def parse_html(filename, charset=None): root = BeautifulSoup(infile, fromEncoding=charset) infile.close() - charset = root.originalEncoding + _charset = root.originalEncoding try: - title = root.html.head.title.string.encode(charset) + title = root.html.head.title.string.encode(_charset) except AttributeError: title = '' @@ -49,7 +49,7 @@ def parse_html(filename, charset=None): else: icon = None - parser = BSoupParser(charset, False, title, refresh, icon) + parser = BSoupParser(_charset, _charset == charset, title, refresh, icon) return parser def _find_refresh(Tag):