Selenium webdriver 如何使用SeleniumWebDriver从td元素获取值
我的html代码:Selenium webdriver 如何使用SeleniumWebDriver从td元素获取值,selenium-webdriver,Selenium Webdriver,我的html代码: <tbody> <tr style="display:none;"> <tr> <td class="intervention"> <td class="notes-count"> <span class="ico ico--paper"></span> 2 </td> 2. 现在我需要使用seleniumwebdriver获取值“2”。请帮帮我。我使用了xp
<tbody>
<tr style="display:none;">
<tr>
<td class="intervention">
<td class="notes-count">
<span class="ico ico--paper"></span>
2
</td>
2.
现在我需要使用seleniumwebdriver
获取值“2”。请帮帮我。我使用了xpath”//div/table/tbody/tr[2]/td[2]/“和getattribute(“value”)
,但它返回空值
如果你需要更多的信息,请告诉我。提前感谢我们可以使用WebElement的getText方法,而不是使用getAttribute方法
类似于Selenium WebDriver的javadoc API我的html代码:2缺少一些代码。正确发布代码。感谢Uma的评论。这是我的第一篇文章,我对在哪里发布代码感到困惑