Reputation: 492
I am trying to get the element by xPath but the text is in the quotation marks and xPath does not work..
Any ideas?
Code when opened as HTML:
<li class="help-menu-item-486 active">
<a href="javascript:void(0)" id="menuItemLink486">
<i id="id31" style="display:none" data-wicket-placeholder=""></i>
Archiv dokumentů
</a>
</li>
Thank you in advance!
I even tried to add % so %Archiv%
- but still no luck..
Upvotes: 0
Views: 1037
Reputation: 1135
As noted in the linked answer above, contains()
takes a single string as a first argument, but text()
is a selector that returns a set of text nodes. Since contains()
can't take a set, it evaluates against the first node in the set, which isn't actually the \nArchiv dokumentů\n
text, but a single newline character between the a
and i
tags, so it doesn't match.
You can use //a[contains(., "Archiv")]
to evaluate a
as a string, which will use all the text in the a
tag.
Upvotes: 2