I have a tree like this:
<table>
<tbody>
<tr>
<td>
<span>MySpan1</span>
</td>
<tr>
<tr>
<td>
</td>
<td>
<div>
<a title="my_title1"></a>
</div>
<td>
</tr>
<tr>
<td>
<span>MySpan2</span>
</td>
<tr>
<tr>
<td>
</td>
<td>
<div>
<a title="my_title2"></a>
</div>
<td>
</tr>
</tbody>
</table>
I need to select <a title="my_title2"></a> knowing that its tr parent must have a sibling tr/td/span[contains(text(),'MySpan2')]
If it is not possible with css selector, then can it be achieved with xpath?