(self, name, attrs, text, limit, generator, **kwargs)
return results
Iterates over a generator looking for things that match.
Iterates over a generator looking for things that match.
Iterates over a generator looking for things that match .
def _find_all(self, name, attrs, text, limit, generator, **kwargs):
        "Iterates over a generator looking for things that match."

        if isinstance(name, SoupStrainer):
            strainer = name
        else:
            strainer = SoupStrainer(name, attrs, text, **kwargs)

        if text is None and not limit and not attrs and not kwargs:
            if name is True or name is None:
                # Optimization to find all tags.
                result = (element for element in generator
                          if isinstance(element, Tag))
                return ResultSet(strainer, result)
            elif isinstance(name, basestring):
                # Optimization to find all tags with a given name.
                result = (element for element in generator
                          if isinstance(element, Tag)
                            and element.name == name)
                return ResultSet(strainer, result)
        results = ResultSet(strainer)
        while True:
            try:
                i = next(generator)
            except StopIteration:
                break
            if i:
                found = strainer.search(i)
                if found:
                    results.append(found)
                    if limit and len(results) >= limit:
                        break
        return results
def _find_all ( self , name , attrs , text , limit , generator , * * kwargs ) : if isinstance ( name , SoupStrainer ) : strainer = name else : strainer = SoupStrainer ( name , attrs , text , * * kwargs ) if text is None and not limit and not attrs and not kwargs : if name is True or name is None : # Optimization to find all tags. result = ( element for element in generator if isinstance ( element , Tag ) ) return ResultSet ( strainer , result ) elif isinstance ( name , basestring ) : # Optimization to find all tags with a given name. result = ( element for element in generator if isinstance ( element , Tag ) and element . name == name ) return ResultSet ( strainer , result ) results = ResultSet ( strainer ) while True : try : i = next ( generator ) except StopIteration : break if i : found = strainer . search ( i ) if found : results . append ( found ) if limit and len ( results ) >= limit : break return results