[b]"What's the best way to build a parser HTML Python for web scraping?"[/b] or [b]"How to efficiently parse HTML

18 Replies, 1711 Views

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.

Messages In This Thread



Users browsing this thread: 1 Guest(s)