how to remove attribute of a etree Element?

shahjapan picture shahjapan · Apr 27, 2010 · Viewed 30.5k times · Source

I've Element of etree having some attributes - how can we delete the attribute of perticular etree Element.

Answer

Amber picture Amber · Apr 27, 2010

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.