]> git.phdru.name Git - bookmarks_db.git/blobdiff - Robots/parse_html_beautifulsoup.py
Some sites put TITLE in HTML without HEAD.
[bookmarks_db.git] / Robots / parse_html_beautifulsoup.py
index 730e263423d9fd25beb943966dc226718924ce12..209486c4054f015a179d4469ccaa5adc3f8bbe8f 100644 (file)
@@ -63,6 +63,9 @@ def parse_html(filename, charset=None):
    except AttributeError:
       return None
 
+   if head is None:
+      head = root.html # Some sites put TITLE in HTML without HEAD
+
    _charset = root.originalEncoding
    try:
       title = head.title.string.encode(_charset)