Como usar o lxml para encontrar um elemento por texto?
Suponha que temos o seguinte html:
<html>
<body>
<a href="/1234.html">TEXT A</a>
<a href="/3243.html">TEXT B</a>
<a href="/7445.html">TEXT C</a>
<body>
</html>
Como faço para encontrar o elemento "a", que contém "TEXT A"?
Até agora eu tenho:
root = lxml.hmtl.document_fromstring(the_html_above)
e = root.find('.//a')
Eu tentei:
e = root.find('.//a[@text="TEXT A"]')
mas isso não funcionou, já que as tags "a" não têm atributo "text".
Existe alguma maneira de resolver isso de forma semelhante ao que tentei?