无效的选择器:无法找到带有XPath表达式的元素:
//span[@class='title-subGrid-lite-TextAutoEllipsis’][text()[contains(.,'My Emails')]
纠正我。
答案 0 :(得分:2)
此错误消息...
org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the xpath expression //span[@class='title-subGrid-lite-TextAutoEllipsis’][text()[contains(.,'My Emails')]
...表示您使用的 XPath 不是有效的。
您如下使用的 xpath 表达式有两个问题:
//span[@class='title-subGrid-lite-TextAutoEllipsis’][text()[contains(.,'My Emails')]
'...'
。[...]
之间必须满足您的要求的简单 XPath 表达式是:
//span[@class='title-subGrid-lite-TextAutoEllipsis'][contains(.,'My Emails')]
您也可以尝试:
//span[@class='title-subGrid-lite-TextAutoEllipsis' and contains(.,'My Emails')]
也许您必须在寻找:
//span[@class='title-subGrid-lite-TextAutoEllipsis'][normalize-space()='My Emails']