def xmlDoc_from_html(response):
 utf8body = (body_as_utf8(response) or ' ')
 try:
  lxdoc = libxml2.htmlReadDoc(utf8body, response.url, 'utf-8', html_parser_options)
 except TypeError:
  lxdoc = libxml2.htmlReadDoc(utf8body.replace('\x00', ''), response.url, 'utf-8', html_parser_options)
 return lxdoc

def xmlDoc_from_html ( response ) : utf8body = ( body_as_utf8 ( response ) or ' ' ) try : lxdoc = libxml2 . htmlReadDoc ( utf8body , response . url , 'utf-8' , html_parser_options ) except TypeError : lxdoc = libxml2 . htmlReadDoc ( utf8body . replace ( '\x00' , '' ) , response . url , 'utf-8' , html_parser_options ) return lxdoc
return libxml2 doc for htmls .