BeautfiulSoupedUp is a little GUI utility for helping construct BeautifulSoup queries. It's a little old and rickety, but you might find it useful (or inspiring to develop something better). Basically you get a GUI like this:
You can cut and paste your own HTML into the center-panel and type your own query in up the top. Then hit the "Run query" button to highlight any matches. If I can still recall correctly after about 5 years, I believe there may be some edge cases that won't work. Sorry. If someone decides to write an equivalent tool as a web browser plugin, perhaps one that runs the query after each character is typed, that would be a big improvement.
I'm pretty sure BeautifulSoupedUp wont' work with the 4.x line of BeautifulSoup, i.e. you'll need to install something from the old 3.x line.