I\'ve looked through several posts but I haven\'t quite found any answers that have solved my problem.
Sample XML =
A solution with lxml
right from the docs:
from lxml import etree
from StringIO import StringIO
xml = etree.parse(StringIO('''
TEXT1 TEXT2 TEXT3 '''))
xml.xpath("//text()")
Out[43]: ['\n', 'TEXT1', 'TEXT2 ', 'TEXT3']
You also can extract the text of an specific node:
xml.find(".//Node[@id='19']").text
The issue here is the text in the XML doesn't belong to any node.