Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のxmlコードを取得しました。minidom.parse 関数を使用してその xml から「コメント」を取得するにはどうすればよいですか? 「user:」とセルの値は取得できますが、「comment」では取得できません。
xml コードが「test.xml」に保存されていると仮定します。
from xml.dom.minidom import parse dom1 = parse("test.xml") for node in dom1.getElementsByTagName('t'): print node.childNodes[0].nodeValue
これにより、すべてのタグ「」の内部値が出力されます。