我想找到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