I've Element of etree having some attributes - how can we delete the attribute of perticular etree Element.
+2
A:
The .attrib
member of the element object contains the dict of attributes - you can use .pop("key")
or del
like you would on any other dict to remove a key-val pair.
Amber
2010-04-27 10:34:45
I found 1 another solution etree.strip_attrbutes(element,'attribute_name'))
Tumbleweed
2010-04-27 12:37:56