我试图在页面上找到要单击的链接:
<a id="folder0" class="js-folder icon-wrap icon-wrap_left menu__item__link menu__item__link_act menu__item__link_unread" href="/messages/inbox" rel="history">
<span class="js-folder-b-unread js-folder-unread menu__item__link__qnt">7</span>
<i class="js-folder-ico icon icon_left icon_folders icon_inbox_act"></i>
<span class="menu__item__link__text menu__item__link__text_linear">Input</span>
</a>
Java代码:
driver.findElement(By.xpath(".//*[@id='folder0']/span[2]")).click();
但是驱动程序找不到元素:
org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"xpath","selector":".//*[@id='folder0']/span[2]"}