]> git.phdru.name Git - bookmarks_db.git/blobdiff - Robots/parse_html_htmlparser.py
No need to call .lower() two times.
[bookmarks_db.git] / Robots / parse_html_htmlparser.py
index 493db3e87fc9388cfaf04e3819128089549b875e..77021624ff9543a82ebe26cc170398a49f13a6bb 100644 (file)
@@ -1,7 +1,7 @@
 """
    HTML Parser
 
-   Written by BroytMann. 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