i am trying to parse an xml like
XBV
ElementTree's XPath support is limited. Use other library like lxml:
import lxml.etree root = lxml.etree.parse('test.xml') path="./pages/page/paragraph[text()='GHF']" print root.xpath(path)