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.
我想通过其域名搜索页面上的链接 - 可能使用contains()?然后只显示该链接的锚文本。
contains()
我已经能够使用所有 a 标签
//a[contains(text(), 'domain_name')]
但无法仅检索锚文本。有人可以帮忙吗?
只需使用text()节点:
text()
//a[contains(@href, 'domain_name')]/text()