HTML:無法點擊鏈接的文本元素硒
td class="tab"><a href="../accountopening/displayintroducer.jsp" target="mainFrame">Introducer</a> </td>
試着用下面定位器
linktext=Introducer, partialinktext
xpath =("//a[href*='../accountopening/displayintroducer.jsp']");
HTML:無法點擊鏈接的文本元素硒
td class="tab"><a href="../accountopening/displayintroducer.jsp" target="mainFrame">Introducer</a> </td>
試着用下面定位器
linktext=Introducer, partialinktext
xpath =("//a[href*='../accountopening/displayintroducer.jsp']");
試試這個XPATH ...
//a[contains(@href,’../accountopening/displayintroducer.jsp’)]
了XPath看來我錯了。
嘗試下面的XPath: -
//a[contains(.,'Introducer')]
OR
//a[@href='../accountopening/displayintroducer.jsp']
或者(更具體)
//a[contains(.,'Introducer') and @target='mainFrame']
希望它會幫助你:)
這裏是回答你的問題:
請嘗試以下xpath
S:
"//a[contains(text(),'Introducer')]"
OR
"//a[contains(@href,'accountopening/displayintroducer.jsp')]"
OR
"//a[contains(text(),'Introducer')][contains(@href,'accountopening/displayintroducer.jsp')]"
讓我知道這個答案是否是您的問題。
謝謝。它正在與第三個選項... –
任何異常你面對? –
請仔細閱讀【問】,特別是關於[mcve](MCVE)的部分,以及[預計需要多少研究工作?](https://meta.stackoverflow.com/questions/261592/how-much-research-effort這是預期的堆棧溢出用戶)這將幫助您調試自己的程序併爲自己解決問題。如果你這樣做並且仍然卡住,你可以回過頭來發布你的MCVE,你試過的,以及執行結果,包括任何錯誤信息,這樣我們可以更好地幫助你。還提供了一個鏈接到頁面和/或相關的HTML。 – JeffC