def METHOD_NAME(element):
    """extract inner text from html
    Analog of jQuery's $(element).text()
    """
    if isinstance(element, (str,)):
        try:
            element = ElementTree.fromstring(element)
        except Exception:
            # failed to parse, just return it unmodified
            return element
    text = element.text or ""
    for child in element:
        text += METHOD_NAME(child)
    text += element.tail or ""
    return text