karl added the comment:
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?
----------
nosy: +karlcow
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue17138>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com