Message183632
http://docs.python.org/3/library/xml.etree.elementtree.html#supported-xpath-syntax
20.5.2. XPath support
This module provides limited support for XPath expressions for locating elements in a tree. The goal is to support a small subset of the abbreviated syntax; a full XPath engine is outside the scope of the module.
What you could do is testing the values with text once you have matched all elements of your choice.
>>> import xml.etree.ElementTree as ET
>>> xml = ET.fromstring("<root><h1>1</h1><p><h1>2</h1></p></root>")
>>> result = xml.findall(".//h1")
>>> for i in result:
... print(i.text)
...
1
2
Could you close the issue? |
|
Date |
User |
Action |
Args |
2013-03-07 03:53:41 | karlcow | set | recipients:
+ karlcow, eli.bendersky, flox, Antoine2008 |
2013-03-07 03:53:41 | karlcow | set | messageid: <1362628421.21.0.723176834481.issue17138@psf.upfronthosting.co.za> |
2013-03-07 03:53:41 | karlcow | link | issue17138 messages |
2013-03-07 03:53:40 | karlcow | create | |
|