我试图在selenium webdriver中获得一个网页的注销按钮的XPath。
这是一个ref标签
<a href="https://www.freecrm.com/index.cfm?logout=1" class="topnavlink"><i class="fa fa-sign-out icon-2x"></i> Logout </a>你能帮上忙吗
发布于 2018-02-20 16:00:17
根据您共享的超文本标记语言,要单击注销按钮,您可以使用以下代码行之一:
Java - cssSelectordriver.findElement(By.cssSelector("a.topnavlinkhref='https://www.freecrm.com/index.cfm?logout=1‘> i.fa.fa-sign-out.icon-2x")).click();
Java - xpath注销并包含(@href,'https://www.freecrm.com/index.cfm?logout=1')/i@class='fa fa- driver.findElement(By.xpath("//a@class='topnavlink‘- icon-2x'")).click();
https://stackoverflow.com/questions/48880213
复制相似问题