If your XPath returns empty, try `.//` instead of `//`—sometimes it’s a scope thing. Also, `*` in XPath can save you when tags are unpredictable.
For performance, `lxml` is already pretty optimized, but if it’s still slow, maybe pre-process the XML with `sed` or `awk` to strip crap you don’t need.
Namespaces? I just ignore ’em and use `local-name()` like a caveman. Works 60% of the time, every time.
For performance, `lxml` is already pretty optimized, but if it’s still slow, maybe pre-process the XML with `sed` or `awk` to strip crap you don’t need.
Namespaces? I just ignore ’em and use `local-name()` like a caveman. Works 60% of the time, every time.
