Given this HTML:
<tr class="even" id="district_22">
<td class="name">Virginia Beach City Public Schools</td>
<td class=""><a href="/admin/districts/22" class="member_link delete_link" data-confirm="Sure?" data-method="delete" rel="nofollow">Delete</a></td>
</tr>
<tr class="even" id="district_23">
<td class="name">Virginia City City Public Schools</td>
<td class=""><a href="/admin/districts/23" class="member_link delete_link" data-confirm="Sure?" data-method="delete" rel="nofollow">Delete</a></td>
</tr>
<tr class="even" id="district_24">
<td class="name">Virginia Town City Public Schools</td>
<td class=""><a href="/admin/districts/24" class="member_link delete_link" data-confirm="Sure?" data-method="delete" rel="nofollow">Delete</a></td>
</tr>
I am trying to use Selenium and xpath with it.
I am having problems when trying to select the ‘delete’ link that belongs to ‘Virginia Beach City Public Schools’.
I am new to xpath.
I am trying:
xpath=(//td[text()='Beach')]/@class.contains('delete'))
but it is not finding the element.
Note: I cannot use the ID as these are repeated tests and the ID changes each time.
Try this: