What's the best way to parse HTML/XML with lxml in Python? or How do you handle large XML files effic

14 Replies, 1836 Views

Hot take: lxml python is overkill for most people. Unless you're parsing *massive* files or need XPath, something like `html5lib` or even the built-in `html.parser` is fine.

But yeah, if speed is your thing, lxml is still king. The Cython stuff makes it scream compared to pure-Python parsers.

Fun fact: lxml's XPath is *way* faster than BeautifulSoup's find_all(). That's where it really shines.

Messages In This Thread



Users browsing this thread: 1 Guest(s)