需要为
创建xpath<div id="sampleDiv" style="width: 100%; overflow-x: hidden; overflow-y: scroll; height: 289px;">
<table style="width:100%; border:0; text-align:left;" class="tableattributes" cellpadding="2" cellspacing="0">
<!-- PRS on TIS - Start -->
<!-- PRS on TIS - End -->
<!-- PRS on TIS - Start -->
<!-- Modified the Code to pass Status as an argument to makeHightlight method -->
<tbody><tr style="background: rgb(246, 246, 204);" onclick="makeHightlight(this,'000290366','Received')" ondblclick="showDetails('onDetail')">
<!-- PRS on TIS - End -->
<!-- Release 15.1 Enhancement T300018844 End -->
<td style="width:10%; text-align:center;"><label class="normal">000290366</label></td>
<td style="width:11%; text-align:center;"><label class="normal"></label></td>
<td style="width:12%; text-align:center;"><label class="normal"></label></td>
<td style="width:8%; text-align:center;"><label class="normal">200850</label></td>
<td style="width:9%; text-align:center;"><label class="normal">Received</label></td>
<td style="width:10%; text-align:center;"><label class="normal">11/11/2017</label></td>
<td style="width:10%; text-align:center;"><label class="normal">10/27/2017</label></td>
<td style="width:10%; text-align:center;"><label class="normal"></label></td>
<td style="width:11%; text-align:center;"><label class="normal">1Z5F0F059090032501</label></td>
<td style="width:8%; text-align:center;"><label class="normal">UPS</label></td>
<td style="width:1;"> </td>
</tr>
</tbody></table>
</div>
试过:
//*[contains(@label,'Received')]"
和
//*[contains(text(),'Received')]"
答案 0 :(得分:0)
您可以尝试使用此Xpath,您将获得已接收文字,正如您所寻找的那样
//table/tbody/tr/td[5]/label