为下面的代码创建一个xpath,它位于一个div内

时间:2017-11-30 13:24:12

标签: xpath

需要为

创建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;">&nbsp;</td>

  </tr>  



</tbody></table>
</div>

试过:

//*[contains(@label,'Received')]"

//*[contains(text(),'Received')]"

1 个答案:

答案 0 :(得分:0)

您可以尝试使用此Xpath,您将获得已接收文字,正如您所寻找的那样

//table/tbody/tr/td[5]/label