def text ( el , strip = True ) : if not el : return "" text = el . text if strip : text = text . strip ( ) return text
python beautifulsoup get text without inner tag
Return the text of a BeautifulSoup element
def text(el, strip=True):
    """
    Return the text of a ``BeautifulSoup`` element
    """
    if not el:
        return ""

    text = el.text
    if strip:
        text = text.strip()
    return text