X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=Robots%2Fparse_html_beautifulsoup.py;h=fa5139f9e210be3dfb5d658f918689b329c0a220;hb=a75f371cee200a4238da59ad4694f417a228cf39;hp=47ecbaf459f367a9a80d535af1add172709dcf0d;hpb=8a8b8b5bf01b5435e19c6854e137a3eff9bbf7d8;p=bookmarks_db.git diff --git a/Robots/parse_html_beautifulsoup.py b/Robots/parse_html_beautifulsoup.py index 47ecbaf..fa5139f 100644 --- a/Robots/parse_html_beautifulsoup.py +++ b/Robots/parse_html_beautifulsoup.py @@ -101,7 +101,11 @@ def parse_html(filename, charset=None, log=None): meta = head.find(_find_contenttype, recursive=False) if meta: try: - __charset = meta.get("content").lower().split('charset=')[1].split(';')[0] + meta_content = meta.get("content") + if meta_content: + __charset = meta_content.lower().split('charset=')[1].split(';')[0] + else: + meta_charset = False except IndexError: # No charset in the META Content-Type meta_charset = False else: