If you’re dealing with *really* nasty HTML, BeautifulSoup + `html5lib` is the combo you want. It’s like the duct tape of parser html python libs—not elegant, but it’ll hold things together.
For speed, though, yeah, lxml wins. Just be ready to handle parsing errors gracefully.
Side note: Mozilla’s docs on XPath are a lifesaver if you go that route.
For speed, though, yeah, lxml wins. Just be ready to handle parsing errors gracefully.
Side note: Mozilla’s docs on XPath are a lifesaver if you go that route.
