Python for Screen Scraping

I've been writing screen scrapers off and on for years. I've read enough Python code to understand this program. Yet, the style of this program really irks me. It's an example of something that works, yet is difficult to read. Without the brief introduction, and the URL embedded within the code, I would have no idea what this program did, and I probably wouldn't care. All I could identify from his program is that it examines an HTML page that contains <tr>, <td>,<a> tags and lots of occurrances of the string http://www.oreilly.com/catalog/

To prove to myself that I'm not being anti-Pythonic, I wrote a screen scraper to do something similar Perl. It took me about ten minutes, mostly because HTML::TableContentParser is such a kickass module, and partly because I can never remember the format of the data it returns.:-) Most screen scrapers I write these days use Data::Dumper while in development to (a) remind me what HTML::TableContentParser returns, and (b) to demonstrate where the content I want to examine is stored.

Here's my version. I've left the comments in, because that's how I wrote the code for myself. I think the intent of this program is much easier to divine based on the code shown below.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Without JavaScript enabled, you might want to
use the classic discussion system instead. If you login, you can remember this preference.