What's the best way to read XML in Python? Need help parsing files efficiently! or How do I read XML

20 Replies, 1083 Views

Honestly, just use `ElementTree` unless you have a specific reason not to. It’s the easiest way to read xml python for most cases.

For attributes, `element.attrib` gives you a dict of them. Looping is as simple as `for elem in root.iter('tagname')`.



Users browsing this thread: 1 Guest(s)