Reputation: 609
<tr>
<td>Principal</td>
<td class="xh-highlight">Brian Jones</td>
</tr>
I am using the following to return a td that contains the word 'princpal':
//td[starts-with(., "Princ")]/following-sibling::td
//td[contains(., 'Princ')]/following-sibling::td
Both work fine, but some of the html pages I am looping through use different terminology so I need to look for different terms. Example, some use 'headmaster' or even just 'head':
<tr>
<td>Headmaster</td>
<td class="xh-highlight">Mrs Baines</td>
</tr>
What I need to do is use some kind of OR statement, I have been playing with variations of this:
//td[contains(., 'Princ' and contains ., 'head' and contains 'chief')]/following-sibling::td
As I need a few tests to find the right one. I cannot get this to return any results.
Upvotes: 2
Views: 1088