HTML無效的XPath:硒稱跨度
<div class="accept"><a class="red_keep popup_action"><span>Click here to view terms</span></a></div>
Xpath的,我曾嘗試:
1. //span[text()='Click here to view terms']
2. normalize-space(//href[@class="red_keep popap_action"]/text()='Click here to view terms')
從上面的XPath他們沒有工作。
您的第一個XPath可以針對HTML代碼段發佈,即成功返回''元素,那麼問題是什麼? – har07