Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How I can target this web element using xpath?

I have this element :

<a> < </a>

This CSS selector was working

a:contains('<') 

But for learning I tried to use the following xpath but without success

//a[text()='<']
//a[normalize-space(text())='<']
//a[contains(text(), '<')]

How I can do that with xpath ?

enter image description here

like image 319
zac Avatar asked Jun 28 '26 01:06

zac


1 Answers

Not sure that xpath is available in the text editor. I belive it must be a valid JS selector.

This is working for me:
a[Text=">"]

like image 149
Trevor Barltett Avatar answered Jul 01 '26 06:07

Trevor Barltett