def parse_html(self, r):
    alerts = []
    if has_lxml:
      try:
        root = lxml.html.fromstring(r.response.content)
        content = ''.join([x for x in root.xpath("//text()") if
                            x.getparent().tag != "script"])
      except __HOLE__:
        alerts.append(stealthy("reponse.content-type says html but " \
                               "unable to parse"))
        return alerts
      except lxml.etree.ParserError:
        return alerts
    else:
      content = r.response.content
    for e in self.html_patterns:
      if e.search(content):
        if has_lxml: # We are more confident of what we've found
          alerts.append(error("response.content matches " + e.pattern))
        else:
          alerts.append(warning("response.content matches " + e.pattern))
    return alerts
dataset/ETHPy150Open securusglobal/abrupt/abrupt/alert.py/GenericAlerter.parse_html