(self, strip=False, types=(NavigableString, CData))
Yield all strings of certain classes, possibly stripping them.

        By default, yields only NavigableString and CData objects. So
        no comments, processing instructions, etc.
Yield all strings of certain classes, possibly stripping them.
Yield all strings of certain classes possibly stripping them .
def _all_strings(self, strip=False, types=(NavigableString, CData)):
        """Yield all strings of certain classes, possibly stripping them.

        By default, yields only NavigableString and CData objects. So
        no comments, processing instructions, etc.
        """
        for descendant in self.descendants:
            if (
                (types is None and not isinstance(descendant, NavigableString))
                or
                (types is not None and type(descendant) not in types)):
                continue
            if strip:
                descendant = descendant.strip()
                if len(descendant) == 0:
                    continue
            yield descendant
def _all_strings ( self , strip = False , types = ( NavigableString , CData ) ) : for descendant in self . descendants : if ( ( types is None and not isinstance ( descendant , NavigableString ) ) or ( types is not None and type ( descendant ) not in types ) ) : continue if strip : descendant = descendant . strip ( ) if len ( descendant ) == 0 : continue yield descendant