views:

147

answers:

1

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
I found 1 another solution etree.strip_attrbutes(element,'attribute_name'))
Tumbleweed