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

20 Replies, 1960 Views

`lxml` is my go-to for *read xml python* tasks. The XPath queries alone save so much time.

```python
from lxml import etree
root = etree.XML(xml_string)
```
Need a specific tag? `root.xpath('//tag')` and you’re done.

ET can’t compete here.

Messages In This Thread



Users browsing this thread: 1 Guest(s)