human
How to use lxml to find an element by text?
assistant
Here is some code to find the`a` tag in html `root` which starts with the text `TEXT A`  and assign it to `e`

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

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