1

When I was writing xml, appeared this error : AttributeError: 'str' object has no attribute 'dom' I don't know what to do...

enter image description here

1
  • 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! Commented Apr 18, 2020 at 4:39

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

I appreciate you !!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.