为什么XPATH方法在这里不起作用?
我正在尝试使用XPath在页面上找到一个元素
Url - https://multi-verse-js.herokuapp.com/main.html
Xpath Value I am using for query - xpath: //a[@class='active'][text()='Web-Search']
Element name I am searching - Web-search
I am trying to find an element on page using xpath but every time I am getting element not found what's wrong here kindly suggest
Url - https://multi-verse-js.herokuapp.com/main.html
Xpath Value I am using for query - xpath: //a[@class='active'][text()='Web-Search']
Element name I am searching - Web-search
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
// a [@class ='active'] [text()='web-search']
正在查找/从网页中找到什么,这就是为什么找不到element
代码>但以下示例选择元素:
//a[@class='active'][text()='Web-Search']
is finding/selecting nothing from the webpage that's why you are gettingelement not found
But the following example select element:
您可以使用部分链接文本
You can use partial linkText