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

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

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