Hello.
Tell me how to find a tag by text inside, if some of the information is dynamic.
I understand how to find statics:
& lt; body & gt;
& lt; a href = "#" & gt; Link & lt; / a & gt;
& lt; / body & gt;
Xpath:
// body / a [text () = "Link"]
What if I only know part of the text?
Thank you.
Answer 1, authority 100%
So:
// body / a [text () [contains (., 'Link')]]
Answer 2, authority 17%
You can use the following option, it searches for all “a” tags that contain “part of the text” // a [contains (text (), 'part of the text')]