【发布时间】:2019-12-19 16:07:06
【问题描述】:
我无法使用以下 Xpath 找到以下标签的文本值。标签的文本包含回车,我认为包含会忽略这一点。有没有办法搜索文本属性并忽略回车?
//*[@id='site-wrapper']//a[contains(text(), 'Report')]
<a target="_blank" href="/Bentley/Reports/74/0/5323914">
<span class="fa fa-print"></span> Report
</a>
【问题讨论】:
-
尝试使用
.(当前节点)而不是text()