我尝试使用此XPath:
//*[contains(normalize-space(text()),'Jira')]
也尝试过:
//*[contains(text(),'Jira')]
在下面的HTML示例中,文本“Jira”之前和之后有空格。我无法点击链接:
<a href="#/crm/usergroup-edit?id=572a3c84e4b07f6189958700"
ng-repeat="gp in groups | filter : userGroupSearch | orderBy:'-name':1"
class="ng-scope">
<div class="inventoryPanel" ng-style="myStyle" style="width: 15.8%;">
<h4 class="ng-binding">
<div class="groupIcon G">
<div class="text ng-binding">P</div>
</div>Jira
</h4>
</div>
</a>
答案 0 :(得分:1)
以下XPath将选择其字符串值包含a
子字符串的所有Jira
个元素:
//a[contains(.,'Jira')]