code: def _parse(self, html):
          
          if self._has_body_re.search(html):
              tree = lxml.html.document_fromstring(html).find('.//body')
              self.has_body = True
          else:
              tree = lxml.html.fragment_fromstring(html,
                                                   create_parent=self._root_tag)
  
          if tree.tag != self._root_tag:
              # ensure the root element exists even if not really needed,
              # so the tree has always the same structure
              root = lxml.html.HtmlElement()
              root.tag = self._root_tag
              root.append(tree)
              return root
          return tree
docs: Parse given string as HTML and return it's etree representation.