【发布时间】:2019-09-08 11:48:54
【问题描述】:
我有 4 个与“HOD”同名的文本,我想点击第一个“HOD”。
我已经尝试了所有这些: 1.//a[包含(文本(),'HOD')][1] 2.//a[@class="link_job ng-binding"][1]
<ul type="none" class="job-search-results ng-scope" ng-if="flag && flag != undefined" id="ulId" ng-repeat="j in jobResult" xpath="1">
<!-- ngIf: j.statusId == 1 --><li ng-if="j.statusId == 1" class="job-small ng-scope"><a href="" class="big-a"></a><a href="" ng-click="fetchJobById(j.id);insertRecentSearch(j.position.id,'aaa')" class="link_job ng-binding">HOD</a>
<div class="ng-binding"><b>Department:</b> Computer_Science</div>
<div><b>Job Summary:</b> <p class="ng-binding">HOD should own masters degree in their onw field.
</p>
</div>
<img ng-src="resources/img/logo-placeholder.png" style="height:64px;" src="resources/img/logo-placeholder.png">
<!-- ngIf: j.status == 'Applied' -->
</li><!-- end ngIf: j.statusId == 1 -->
<!-- ngIf: j.statusId !=1 -->
</ul>
I expect that it should click on first HOD text.
【问题讨论】:
-
当你尝试的时候发生了什么?
-
未知错误:元素 ... 在点 (622, 402) 是不可点击的。其他元素会收到点击:
-
当您尝试点击您的链接时,您的页面加载完成了吗?
-
通过使用相对的 xpath 我可以 clcik 它..但它不能通过我自己的 xpath 工作
-
是的,我使用了 time.delay(10) 并且它成功了,感谢两者