Obtenez des nœuds de XML dans Python
import xml.dom.minidom
dom = xml.dom.minidom.parseString(document)
def getText(nodelist):
rc = []
for node in nodelist:
# check if it is TEXT node or not.
# if it is text node then we are getting the data.
if node.nodeType == node.TEXT_NODE:
rc.append(node.data)
return ''.join(rc)
Pythonist