X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=parse_html%2Fbkmk_ph_htmlparser.py;h=d7020b03e933a9d822c541fe9c3936a5e0310ee1;hb=a3bdba992715f6282e112e06a2beee15d20b69ca;hp=5c0a440ff7fea80bba26b58a0e729b75df8567cc;hpb=71712390f4edb041609ff7bc9272d12a5c1a9b1d;p=bookmarks_db.git diff --git a/parse_html/bkmk_ph_htmlparser.py b/parse_html/bkmk_ph_htmlparser.py index 5c0a440..d7020b0 100644 --- a/parse_html/bkmk_ph_htmlparser.py +++ b/parse_html/bkmk_ph_htmlparser.py @@ -4,7 +4,7 @@ This file is a part of Bookmarks database and Internet robot. """ __author__ = "Oleg Broytman " -__copyright__ = "Copyright (C) 1997-2012 PhiloSoft Design" +__copyright__ = "Copyright (C) 1997-2013 PhiloSoft Design" __license__ = "GNU GPL" __all__ = ['parse_html'] @@ -40,6 +40,9 @@ class HTMLParser(_HTMLParser): http_equiv = value.lower() elif attrname == 'content': content = value + elif (attrname == 'charset') and (not self.charset): + self.charset = value.lower() + self.meta_charset = 1 if (not self.charset) and (http_equiv == "content-type"): try: @@ -93,7 +96,6 @@ def parse_html(filename, charset=None, log=None): except (HTMLParseError, HTMLHeadDone): pass - if parser.title is None: + if (parser.title is None) and (parser.refresh is None) and (parser.icon is None): return None - return parser