为什么我的 xpath 表达式没有解决问题?
Why my xpath expression doesn't solved the question?
我练习构建 xpath 表达式。
我找到了以下任务:
Select the small apple and the big orange
<div class='table'>
<plate id="fancy">
<apple class="small"/>
</plate>
<plate>
<orange class="small"/>
<orange/>
</plate>
<pickle class="small"/>
</div>
我不明白为什么下面的表达式不能解决问题:
//apple[@class='small']|//orange[last()]
给select你需要用到的小苹果和大橘子:
//apple[@class='small']|//orange[position()=last()]
快照:
这个网站非常固执己见,即它不接受所有正确答案,只接受特定答案。
他们想要的是:
//plate[@id='fancy']/apple | //orange[last()]
我练习构建 xpath 表达式。 我找到了以下任务:
Select the small apple and the big orange
<div class='table'>
<plate id="fancy">
<apple class="small"/>
</plate>
<plate>
<orange class="small"/>
<orange/>
</plate>
<pickle class="small"/>
</div>
我不明白为什么下面的表达式不能解决问题:
//apple[@class='small']|//orange[last()]
给select你需要用到的小苹果和大橘子:
//apple[@class='small']|//orange[position()=last()]
快照:
这个网站非常固执己见,即它不接受所有正确答案,只接受特定答案。
他们想要的是:
//plate[@id='fancy']/apple | //orange[last()]