]> git.phdru.name Git - bookmarks_db.git/blobdiff - parse_html/bkmk_ph_htmlparser.py
Fix(parse_html/bkmk_ph_beautifulsoup4): Fix title recombination
[bookmarks_db.git] / parse_html / bkmk_ph_htmlparser.py
index b90618f1856d37a99bd78e7931421aa67e6d45b3..c0f89b411d688bc99ecaab1a377c80abb36b6891 100644 (file)
@@ -11,7 +11,10 @@ __license__ = "GNU GPL"
 __all__ = ['parse_html']
 
 
-from HTMLParser import HTMLParseError
+try:
+    from HTMLParser import HTMLParseError
+except ImportError:
+    class HTMLParseError(Exception): pass
 from m_lib.net.www.html import HTMLParser as _HTMLParser
 
 
@@ -86,6 +89,8 @@ class HTMLParser(_HTMLParser):
 
 
 def parse_html(html_text, charset=None, log=None):
+    if not html_text:
+        return None
     parser = HTMLParser(charset)
 
     try: