When I was writing xml, appeared this error : AttributeError: 'str' object has no attribute 'dom' I don't know what to do...
-
Hi, welcome to the community. Your question doesn't follow the guidelines to ask a good question in the site. Please refer to how to ask?. You need to edit your question to add your code and errors in text mode.Thanks!EnriqueBet– EnriqueBet2020-04-18 04:39:35 +00:00Commented Apr 18, 2020 at 4:39
Add a comment
|
1 Answer
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.
1 Comment
JustinHsu
I appreciate you !!