我的情况是,当 a [数据 - 时,我需要点击元素 a [data-action ='删除条件'] action =" edit-criteria"] 匹配字符串..
任何帮助,非常感谢!!
我已经为此提供了代码..
<table class="table table-striped">
<thead>
<tbody>
<tr scope="row">
<td>Own publishers</td>
<td class="input-lg">
<div class="label label-primary">Contained in list</div>
<a class="btn btn-default" data-value="22323" data-operator="list" data-attribute="pubs" data-section="supply_filter" data-action="edit-criteria" href="#">22323</a>
<a class="text-danger" data-value="22323" data-operator="list" data-attribute="pubs" data-section="supply_filter" data-action="remove-criteria" href="#"/>
<span>,</span>
<a class="btn btn-default" data-value="223232323" data-operator="list" data-attribute="pubs" data-section="supply_filter" **data-action="edit-criteria"** href="#">223232323</a>
<a class="text-danger" data-value="223232323" data-operator="list" data-attribute="pubs" data-section="supply_filter" **data-action="remove-criteria"** href="#">
</td>
</tr>
</tbody>
</table>
答案 0 :(得分:1)
使用以下xPath
获取与data-value
//a[@data-action = 'remove-criteria' and @data-value = '22323']
希望它会对你有所帮助.. :)