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.
我想获取一个元素的所有属性(不知道属性的名称)。有什么功能吗?谢谢
>>> 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')]