There is for example such piece of code:
<tr>
<td width="270" class="news">
<a href="/lists/test_acc/1/" class="all">Ukraine</a>
<span>17.06.15<span>
</td>
</tr>
<tr>
<td width="270" class="news">
<a href="/lists/test_acc/1/" class="all">France</a>
<span>17.06.15<span>
</td>
</tr>
<tr>
<td width="270" class="news">
<a href="/lists/test_acc/1/" class="all">USA</a>
<span>17.06.15<span>
</td>
</tr>
<tr>
<td width="270" class="news">
<a href="/lists/test_acc/1/" class="all">France</a>
<span>10.10.15<span>
</td>
</tr>
<tr>
<td width="270" class="news">
<a href="/lists/test_acc/1/" class="all">Germany</a>
<span>17.06.15<span>
</td>
</tr>
<tr>
<td width="270" class="news">
<a href="/lists/test_acc/1/" class="all">France</a>
<span>23.12.15<span>
</td>
</tr>
In dev panel in Chrome this xpath //tr/td/a[text()="France"]
shows me 3 results.
I cant find the way to get the value I need.
For example, how to get the date of 2nd result (10.10.15)?
I tried different ways with position
, something like //tr/td/a[text()="France"][position=2]/span/text()
and //tr/td/a[position(text()="France")][2]/span/text()
etc, but no success. Maybe "position" is not what I need?
EDITED: Positions of "France" in code differ depends on a page. In the example above right now positions are 2,4,6, but on the other page it can be 3,10,15,25,27. How to get the 2nd result and the last one, without taking into account the position where 'France' actually located?