human
How to use lxml to find an element by text?
assistant
Here is some code to find the element that holds string 'TEXT A' in file `root`

e = root.xpath('.//a[text()="TEXT A"]')

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.