2012-06-11 38 views

回答

8
>>> 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')]