我想点击发布报告按钮,因此我使用此xpath->//button[@class='btn btn-success btn-block']
。
我想点击拥有href='http://www.jbalbertos.com'
的按钮,意味着xpath应该像//div/a[@href='http://www.jbalbertos.com/']
和//button[@class='btn btn-success btn-block']
如果有人知道请给我正确的xpath声明。
<div class="search-business-description">
<div class="business-name ng-binding">J.B. Alberto's Pizza</div>
<div class="business-address ng-binding">
<div class="business-website">
<span class="ng-binding" ng-bind-html="getWebsite()"><a target="_blank" href="http://www.brchichago.com/">http://www.brchichago.com/</a>
</span>
</div>
</div>
<div class="business-website">
<span class="ng-binding" ng-bind-html="getWebsite()"><a target="_blank" href="http://www.jbalbertos.com/">http://www.jbalbertos.com/</a></span>
</div>
<div class="business-actions">
<button class="btn btn-success btn-block" ng-click="onPublish(result)">
</div>
</div>
答案 0 :(得分:0)
如果我理解正确
//div[//a[@href='http://www.jbalbertos.com/']]/following-sibling::div[@class="business-actions"]/button[@class='btn btn-success btn-block']