Reputation: 57
I was using parse function to modify a xml and it worked but I tried to use .fromstring and it showed an error
AttributeError: 'Element' object has no attribute 'getroot'
here is the part of code.
AttributeError: 'Element' object has no attribute 'getroot'
Upvotes: 2
Views: 3984
Reputation: 31
This is because the fromstring method returns the root object already. SO whatever your var that stores the information form the "fromstring()" method is, that var is the root.
Upvotes: 3