xml - XPath for anchor in sibling TD -


i tying work out xpath select tag in 2nd sibling td 1 matches "paypal sale". there many such rows on table wanting first match.

here's html

 <tr>    <td class="ref">paypal sale</td>    <td class="icon">...</td>    <td class="from"><a class="nav" href="http://google.com">click here</a></td>  </tr>  ...  <tr>    <td class="ref">paypal sale</td>    <td class="icon">...</td>    <td class="from"><a class="nav" href="http://google.com">click here</a></td>  </tr> 

so far have not working:

//tr[td=\'paypal sale\'][1]/following-sibling::td[2]/a 

try this:

//tr/td[. = 'paypal sale']/following-sibling::td[2]/a 

Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -