Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
<a href="xxxx"><i class="xxxx"></i>PDF</a>
假设我有一些类似上面的 HTML 代码。我想a通过匹配单词来查找PDF。text()在这种情况下不起作用。谁能告诉我匹配尾随文本的正确方法是PDF什么a?谢谢。
a
PDF
text()
您可以简单地使用//a[.='PDF']如下所示。
//a[.='PDF']