【发布时间】:2019-06-10 19:30:43
【问题描述】:
我无法在以下代码的文章中检测到按钮:
<article id="ride-f6ba24ca-d847-44b7-987e-81db6e6dee47" class="DetailPage__container--1VLdd"><div class="DetailPage__highlights--1uyrQ"><section></section><form aria-label="Offer highlights" class="DetailPage__section--qtXxV"><button type="submit"><span>Accept offer</span></button></form></div></article>
我试试:
driver.findElement(By.xpath("//*[text()='Details']"))
driver.findElement(By.xpath("//button[.//span[text()='Accept offer']]"))
没有运气
我无法在 java 中检测到元素 Accept offer with selenium
【问题讨论】:
-
在一个框架中?动态加载(所以你需要等待)?这些是通常的罪魁祸首......
标签: java selenium xpath css-selectors webdriverwait