except (ValueError, IndexError):
charset = None
self.log(" no charset in Content-Type header")
+ is_html = False
for ctype in ("text/html", "application/xhtml+xml"):
if content_type.startswith(ctype):
- html = True
+ is_html = True
break
- else:
- html = False
- if html:
+ if content and is_html:
parser = parse_html(content, charset, self.log)
if parser:
bookmark.real_title = parser.title
% (url, timeout)
)
+ if not content:
+ self.log(" empty response, no content")
+ if not is_html:
+ self.log(" not html")
except KeyError as key:
self.log(" no header: %s" % key)