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.
1つの要素のすべての属性を取得したいと思います(属性の名前を知らなくても)。そのための機能はありますか?ありがとう
>>> docu = '<a href="http" alt=":)"></a>' >>> dom = xml.dom.minidom.parseString(docu) >>> a = dom.getElementsByTagName("a")[0] >>> a.attributes.items() [(u'alt', u':)'), (u'href', u'http')]