I'd use XPATH, see here for a question what package would be appropriate in Python.
Just curious as to why XPATH over BeautifulSoup? I've never used XPATH, but BeautifulSoup seems to be a standard answer for HTML/XML parsing as per the OP's question.
I tend to work with more rigid formats, and prefer plainer errors. BeautifulSoup could indeed be a better answer if the HTML isn't to be trusted though, but I'd still be tempted to us XPath because of it's portability.
Thanks, I'll have to take a look into XPATH.