data = """
<ol>
<li>a</li>
<li>b</li>
<li>c</li>
<li>d</li>
</ol>
"""
tree = ET.fromstring(data)
value = 'c'
int(tree.xpath("count(//ol/li[. = '%s']/preceding-sibling::li)" % value))
Find the number(position) of a node in list