我想找到RetailDischarge
的XPath从以下HTML span
和class
正确的XPath:我想跨度和
RetailDischarge
我的脚本是:
driver.findElement(By.xpath("//[@class='menu-item-title']/span[text()='RetailDischarge']")).click();
我得到了错误消息:
无效的选择器:无法找到一个EL用的XPath表达式
我想找到RetailDischarge
的XPath从以下HTML span
和class
正确的XPath:我想跨度和
RetailDischarge
我的脚本是:
driver.findElement(By.xpath("//[@class='menu-item-title']/span[text()='RetailDischarge']")).click();
我得到了错误消息:
无效的选择器:无法找到一个EL用的XPath表达式
EMENT这无疑将与工作
driver.findElement(By.xpath("//span[contains(text(),'RetailDischarge')]"));
“RetailDischarge” –
Saad,它不起作用。这里是我的Html,我需要点击链接“RetailDischarge”。 Thiru
–什么是错误..可能是加载问题。你有没有提供等待.. ?? –
请具体说明。我们不知道零售排放究竟是什么,因为它可能是您的个人申请。如果无法找到该位置,请尝试使用相对xpath。 –
我想单击“RetailDischarge”中的“RetailDischarge”菜单,其范围为 – Thiru