What's the best way to parse XML in Python? Need help with 'parse xml python'! or Struggling to parse

16 Replies, 1280 Views

`ElementTree` is fine for small stuff, but if you’re dealing with big files, `lxml` is the way to go.

Pro tip: disable unused features like comments or DTDs to speed things up.

Also, avoid parsing the whole thing at once—use `iterparse` like someone else said.

Python’s docs have a section on this, btw.

Messages In This Thread



Users browsing this thread: 1 Guest(s)