2013-07-30 58 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()