I assume same is true with python minidom if node.hasAttributename') == name: parent.removeChild(node) mydom是一个minidom= node.parentNode()
TypeError: 'Element' object is not
我试图用Python minidom库解析.xml文件中的元素,但似乎不起作用。它返回"IndexError list out of range“。也许我使用的方法/库不正确。请建议如何执行此操作。谢谢 from xml.dom import minidomdocs = doc.getElementsByTagName