【问题标题】:using selenium webdriver I am not able to identify the hidden < href > element使用 selenium webdriver 我无法识别隐藏的 < href > 元素
【发布时间】:2016-04-14 23:36:48
【问题描述】:
  <li class="rktpage">
drop a Conmerce
<ul style="visibility: hidden;">
<li class="">
<a href="/dom_config/ui/loc/insert">rtw By user</a>
</li>

我很难识别“drop a Conmerce”选项卡下的“rtw By user”href 元素

【问题讨论】:

标签: html selenium-webdriver


【解决方案1】:

查找文本

 driver.findElements(By.tagName("li")).get(index_of_li_tag).getText();

查找href属性值

driver.findElement(By.id("li")).get(index_of_li_tag).getAttribute("href");

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-15
    • 2012-09-03
    • 2020-01-29
    相关资源
    最近更新 更多