Skip to content

Instantly share code, notes, and snippets.

@canimus
Created April 18, 2020 19:02
Show Gist options
  • Save canimus/8904a153dbd9e0fd757fd6cc720bd9bf to your computer and use it in GitHub Desktop.
Save canimus/8904a153dbd9e0fd757fd6cc720bd9bf to your computer and use it in GitHub Desktop.
Etree remove namespace
from lxml import etree
from functional import seq
p = etree.load(open('a.xml'))
root = p.getroot()
seq(root.getchildren()).map(lambda x: etree.QName(x).localname)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment