請幫我創建XPATH。我想要使用動態網址刪除該項目。這裏是DOM結構。 '燈塔名稱','Major:22'沒有改變。只有href被改變。爲硒創建動態xpath
<div class="panel panel-default panel-small">
<div class="panel-heading">
<h3 class="panel-title">beacon name</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-4 preview-data"> UUID: E4504AB5-309C-41BF-BAC4-C384A9EBE57A </div>
<div class="col-sm-2 preview-data"> Major: 22 </div>
<div class="col-sm-2 preview-data"> Minor: 33 </div>
<div class="col-sm-4">
<div class="action-btns pull-right">
<a class="btn btn-default btn-xs" href="/beacons/114/edit?back_to=%2Fbeacons">Edit</a>
<a class="btn btn-danger btn-xs" data-confirm="Are you sure?" rel="nofollow" data-method="delete" href="/beacons/114?back_to=%2Fbeacons">Delete</a>
</div>
</div>
</div>
</div>
</div>
的XPath我想:
//a[contains('beacon name',/'Delete')]
向我們顯示您的代碼。 – Kapil
// a [contains('beacon name',/'Delete')] –
這不會幫助太:// a [contains('beacon name')and text()='Delete']「 –