X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=Robots%2Fparse_html_htmlparser.py;h=77021624ff9543a82ebe26cc170398a49f13a6bb;hb=a788e94901728a5ea127b2c09e3a13ff6a5447b9;hp=df37f752d86a3a55b7057b5357daf57e1c8efbe6;hpb=0e76f1851882b99da63a7c8a9e4cdf0c4a48657f;p=bookmarks_db.git diff --git a/Robots/parse_html_htmlparser.py b/Robots/parse_html_htmlparser.py index df37f75..7702162 100644 --- a/Robots/parse_html_htmlparser.py +++ b/Robots/parse_html_htmlparser.py @@ -1,7 +1,7 @@ """ HTML Parser - Written by Broytman. Copyright (C) 1997-2008 PhiloSoft Design + Written by Broytman. Copyright (C) 1997-2010 PhiloSoft Design """ from HTMLParser import HTMLParseError @@ -63,7 +63,7 @@ class HTMLParser(_HTMLParser): for attrname, value in attrs: if value: - value = value.strip().lower() + value = value.strip() if (attrname == 'rel') and (value.lower() in ('icon', 'shortcut icon')): has_icon = True elif attrname == 'href': @@ -90,4 +90,7 @@ def parse_html(filename, charset=None, log=None): except (HTMLParseError, HTMLHeadDone): pass + if parser.title is None: + return None + return parser