how do I use empty namespaces in an lxml xpath query?
Something like this should work:
import lxml.etree as etns = {"atom": "http://www.w3.org/2005/Atom"}tree = et.fromstring(xml)for node in tree.xpath('//atom:entry', namespaces=ns): print node
See also http://lxml.de/xpathxslt.html#namespaces-and-prefixes.
Alternative:
for node in tree.xpath("//*[local-name() = 'entry']"): print node