Edit: which isn't meant to detract from the fact that this is a great article.
Also, this page maintains links to many python parsing options - http://nedbatchelder.com/text/python-parsers.html
https://github.com/dropbox/pyxl
I don't work at Dropbox but I did work at Cove where this was originally developed and it is great. Makes working with HTML in Python so easy.
I also my own version of it that I have rewritten to treat the HTML object more like jQuery does and added more jQuery methods to it.
So, in the interest of sharing I thought I'd mention a couple of interesting libraries I came across.
In Ruby I think Temple (https://github.com/judofyr/temple) is really quite cool. It's designed to make creating templating languages really easy, and constructs ASTs using user-defined parsers.
And even more interesting in my opinion is Haskell's Parsec (http://www.haskell.org/haskellwiki/Parsec). It uses combinators to build up parsers, and can produce friendly parse error messages "for free."
Thanks for the intersting read.
Something along these lines: https://github.com/thomaslee/viking-poc/blob/master/viking#L...
(Disclaimer: I wrote the Python-AST-to-PyObject transformation code for Python 2.6 that made this sort of stuff possible -- fun hack!)