[b]"What's the best way to parse HTML/XML with Python lxml?"[/b] or [b]"Python lxml: How do you handle namespaces

18 Replies, 1515 Views

BS4 fan here! The biggest win for me is how it handles *broken* HTML. Real-world data is messy, and BS4 just... works. Lxml’s stricter parsing can be a pain sometimes.

That said, if you’re working with clean XML (like API responses), python lxml is unbeatable. The XPath support is *chef’s kiss*.

Tool rec: `requests-html` if you want a batteries-included scraping experience—it’s built on lxml but feels like BS4.

Messages In This Thread



Users browsing this thread: 1 Guest(s)