< Previous
Damn frogs, stealing our women! >

: Beautiful Soup 2.1.0 contains a bunch of new methods that solve a large class of problems that previously required that you write a while loop that navigated the parse tree.

I'd been meaning to do this for a while, but the impetus for me actually doing it was that I ended up writing one of those while loops in the screen-scraping script I wrote for the vaporware Productivity Hacks book. With the new stuff in 2.1.0 I could trim a line of code from the manuscript and make it easier to explain.

In fact, Beautiful Soup 2.0 (and the RSS feed builder mentioned earlier, which is going to have a life of its own once I finish the hack) was done for the same reason: so I wouldn't have to explain in print what this complicated code was supposed to do. This is the true power of documentation: it forces you to make things work in a way that's easier to explain. Assuming you care about the people who are reading your documentation, I mean.


Unless otherwise noted, all content licensed by Leonard Richardson
under a Creative Commons License.