Struggling with parsing XML in Python lxml? Need help with XPath or performance tips? or What’s the b

16 Replies, 1117 Views

OP here—y’all are legends!

Tried the `local-name()` trick and it worked like a charm for the namespace nightmare. Also, `iterparse` + `clear()` is *chef’s kiss* for big files.

One follow-up: Anyone know why `//element` sometimes misses stuff but `.//element` works? Is it a scope thing or am I just cursed?

And yeah, `lxml` > ElementTree. Fight me. 😆

Messages In This Thread



Users browsing this thread: 1 Guest(s)