get text from xml node (xml.dom)


/ Published in: Python
Save to your folder(s)



Copy this code and paste it in your HTML
  1. def get_text(node_list):
  2. text = []
  3. for node in node_list:
  4. if node.nodeType == node.TEXT_NODE:
  5. text.append(node.data)
  6. return "".join(text).strip()

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.