2013-04-24 127 views
-3

我的HTML代碼來從TD元素的值:如何使用硒的webdriver

<tbody> 


<tr style="display:none;"> 

<tr> 

<td class="intervention"> 

<td class="notes-count"> 

<span class="ico ico--paper"></span> 

2 

</td> 

現在我需要使用selenium webdriver來獲取值「2」。請幫幫我。我已使用xpath "//div/table/tbody/tr[2]/td[2]/" and getattribute("value ")但返回空值

如果您需要更多信息,請讓我知道。由於提前

+0

我的HTML代碼: <跨度類= 「意高ICO - 紙」> – Ramesh 2013-04-24 12:55:58

+0

某些代碼丟失。正確地發佈代碼。 – 2013-04-24 14:32:44

+0

感謝Uma的評論。這是我的第一篇文章,我對發佈代碼的位置感到困惑 – Ramesh 2013-04-24 15:37:03

回答

-1

那麼使用WebElement的的getText方法,而不是使用的getAttribute方法

Here就像是javadoc的API爲硒的webdriver