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

18 Replies, 2036 Views

lxml all the way if you care about speed! It’s a beast for parser html python stuff, but like you said, it’s picky.

If the HTML’s a disaster, maybe pre-clean it with something like `tidy` or `bleach` before throwing it at lxml.

Also, check out `selectolax`—it’s a newer parser html python lib that’s *blazing* fast and a bit more forgiving than lxml.

Messages In This Thread



Users browsing this thread: 1 Guest(s)