def findElements(parent, matcher):
    """
    Return an iterable of the elements which are children of C{parent} for
    which the predicate C{matcher} returns true.
    """
    return findNodes(
        parent,
        lambda n, matcher=matcher: getattr(n, 'tagName', None) is not None and
                                   matcher(n))

    Return an iterable of the elements which are children of C{parent} for
    which the predicate C{matcher} returns true.
    
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/domhelpers.py