Comment 7 for bug 2047713

Revision history for this message
Chris Papademetrious (chrispitude) wrote : Re: enhance find*() methods to filter through all object types

I pulled your branch and played with this. Wow, this is super cool!!

And for simple tests (like the whitespace one), you can put an anonymous lambda function right in the ElementClass() call:

====
match_non_whitespace = ElementMatcher(lambda element:
  not (isinstance(element, NavigableString) and element.text.isspace())
)
====

I like the ElementMatcher name. It intuitively describes its purpose.

This is just awesome. Please let me know how I can help.