XPath can be super finicky, especially with namespaces. One trick I use is `//*[local-name()='tagname']` as a quick fix when namespaces are messing things up.
For big files, try `lxml.etree.iterparse()` with `events=('end',)` and clear nodes you don’t need anymore (`elem.clear()`). Saves a ton of memory!
Also, check out `xmllint` for debugging XPath—it’s a CLI tool but super handy.
And yeah, namespaces… ugh. I usually just strip ’em with `lxml.etree.strip_namespaces()` if I don’t need ’em.
For big files, try `lxml.etree.iterparse()` with `events=('end',)` and clear nodes you don’t need anymore (`elem.clear()`). Saves a ton of memory!
Also, check out `xmllint` for debugging XPath—it’s a CLI tool but super handy.
And yeah, namespaces… ugh. I usually just strip ’em with `lxml.etree.strip_namespaces()` if I don’t need ’em.
