X-Git-Url: https://git.phdru.name/?p=bookmarks_db.git;a=blobdiff_plain;f=Robots%2Fparse_html_lxml.py;h=638af4e972cab376c1fa2f142494a8eea74b9cce;hp=7aba09cbf5d426e2edf21c96fc4ae3375cef36ac;hb=1a001aafb9fefdbc003ee5ce49ca19d4f4f7e3ec;hpb=8bc6571d6eaba3a72ecb543c0fe9b95dbea31634 diff --git a/Robots/parse_html_lxml.py b/Robots/parse_html_lxml.py index 7aba09c..638af4e 100644 --- a/Robots/parse_html_lxml.py +++ b/Robots/parse_html_lxml.py @@ -11,6 +11,9 @@ from parse_html_util import HTMLParser def parse_html(filename, charset=None, log=None): html_tree = parse(filename) + if t.getroot() is None: + return None + title = html_tree.findtext('head/title') if title is None: title = html_tree.findtext('title')