Reputation: 13
When I was writing xml, appeared this error : AttributeError: 'str' object has no attribute 'dom' I don't know what to do...
Upvotes: 1
Views: 1148
Reputation: 22952
When you do import xml.dom.minidom
, You import xml
. But, your certainly also use xml
as a global variable. So, the global variable is hiding the imported module.
Use a different name for your variable, for instance tree
or xml_tree
are common choices.
Upvotes: 1