]> git.phdru.name Git - bookmarks_db.git/blobdiff - Robots/parse_html_html5.py
Lookup title in html if not found in head.
[bookmarks_db.git] / Robots / parse_html_html5.py
index 23020515aca8532d84ddbe3088f2d09f638c3c37..43e8d74ba957f658ffef276cadb2782ac27e84e5 100644 (file)
@@ -83,4 +83,16 @@ def parse_html(filename, charset=None, log=None):
                 icon = node.attributes['href']
                 break
 
+    else:
+        for node in html.childNodes:
+            if node.name == 'title':
+                if node.childNodes:
+                    title = node.childNodes[0].value
+                    break
+                else:
+                    title = ''
+
+        if title is None:
+            return None
+
     return HTMLParser(charset, meta_charset, title, refresh, icon)