1

要素の xpath を見つけるのを手伝ってください。 @class="middleNav" を持つ 2 番目の [2] で @class="tipN button greenB" を見つけたいです。

    <div id="rightSide"> 
<div class="topNav"> 
<style type="text/css"> 
<div class="resp"> 
<div class="titleArea"> 
<div class="wrapper"> 
<div class="pageTitle"> 
<div class="middleNav" data-bind="visible: showAllButtons" style="display: none;"> 
<a id="saveformtop" class="tipN button greenB" data-bind="click: SaveForm, visible: showGridButtons" original-title="Save Staff data" href="#" style="margin: 5px; display: none;" novalidate="novalidate"> 
<a class="tipN button greenB" original-title="Save Staff data" href="#" style="margin: 5px;" data-bind="click: SaveRestrictions, visible: showRestriction"> 
<a id="cancelbtntop" class="tipN button redB" original-title="Cancel all edits" data-bind="click:CancelForm, visible: showGridButtons" style="margin: 5px; display: none;"> 
<a class="tipN button redB" original-title="Cancel all edits" data-bind="click: CancelRestriction, visible: showRestriction" style="margin: 5px;"> 
<div class="clear"> </div> 
</div> 
<div class="middleNav" data-bind="visible: !showAllButtons()" style=""> 
<a id="cancelbtntop" class="tipN button redB" original-title="Cancel all edits" data-bind="click:CancelForm, visible: showGridButtons" style="margin: 5px; display: none;"> 
<img class="icon" src="../../content/css/images/icons/light/arrowLeft.png" alt=""> 
<span>Back</span> 
</a> 
<a class="tipN button greenB" original-title="Save Staff data" href="#" style="margin: 5px;" data-bind="click: SaveRestrictions, visible: showRestriction"> 
<img class="icon" src="../../content/css/images/icons/light/check.png" alt=""> 
<span>Save</span> 
</a> 
<a class="tipN button redB" original-title="Cancel all edits" data-bind="click: CancelRestriction, visible: showRestriction" style="margin: 5px;"> 
<div class="clear"> </div> 
</div> 
</div> 
</div> 
<div class="clear"> </div> 
<div class="line"> </div> 
<div> 
</div> 
<div id="footer"> 
<style> 
<div id="leftsidehide" style="display: none;"> 
</div>
4

3 に答える 3

1

あなたの質問を完全に理解しているかどうかわかりません。しかし、ここで私が理解したことから何をするかです:

//*[contains(@class, 'middleNav')][2]/*[contains(@class, 'tipN button greenB')]
于 2013-07-10T12:10:40.953 に答える