Reputation: 180808
I have the following HTML (a small part of a larger HTML document):
<tr class="even">
<td width="35%"><strong>Restrictions or particulars</strong></td>
<td>
MAINTENANCE OF REFRIGERATION/AIR CONDITIONING UP TO 1000v - REFRIGERATION/AIRCON EQPT<br>
</td>
</tr>
What would be the XPath expression that identifies the string Restrictions or particulars
, and then returns the text in the immediately following td
(MAINTENANCE OF REFRIGERATION/AIR CONDITIONING UP TO 1000v - REFRIGERATION/AIRCON EQPT
)?
Upvotes: 0
Views: 440
Reputation: 134891
There's a number of ways you could do this. I would select the surrounding tr
node that has the associated td
with that name, then take the second td
.
//tr[td[1]='Restrictions or particulars']/td[2]
Upvotes: 1
Reputation: 180808
//tr[contains(td, 'Restrictions or particulars')]/td[2]/text()
Upvotes: 0