[b]"What's the best way to parse HTML with Python lxml?"[/b] or [b]"Python lxml vs. BeautifulSoup – which one do y

20 Replies, 1158 Views

I'm team BeautifulSoup all the way! Yeah, python lxml is faster, but BS4 just *works* when the HTML is a total mess.

Plus, the docs are way friendlier. If you're not scraping huge sites, the speed difference doesn't even matter.

For cleanup, I sometimes use both—lxml to parse fast, then BS4 to prettify. Overkill? Maybe. But it saves headaches.

Messages In This Thread



Users browsing this thread: 1 Guest(s)