2013-07-30 64 views
0

我需要使用Xpath获取所选单选按钮的值(82)。我对Xpath不熟悉。我如何使用Xpath获取文本82?使用Xpath查找值

<label id="thankyou_label" class="itemName radio" for="thankyou_radio"> 
<input id="thankyou_radio" class="cardFilterItemSelection" type="radio" name="occasionGroup" value="Thank You" tagtype="Occasion" checked="checked"> 
<span class="occasion_display_name">Thank You </span> 
<span class="itemCount">(82)</span> 
</label> 

回答

2

请尝试this.you可以使用下面的代码,而无需使用xpath.Cheers

page.find('.itemCount').text 
+1

谢谢它现在的工作! !!!!!!!!!!!!! – chinchu

1

,您可以使用这里的XPath是:

//input[@class = 'cardFilterItemSelection' and @checked = 'checked']/following-sibling::span[@class = 'itemCount']/text()