Reputation: 2268
So I have this DOM structure
<body>
<div>
<a></a>
<a></a>
</div>
<div>
<a></a>
</div>
</body>
I can access two first link element by using xpath:
//div/a[1]
//div/a[2]
And I want to access 3rd link by using same xpath structure (to enumerate them all)
//div/a[3]
But this method fails, because link elements have different parent div's Any way to correct my xpath to access all link elements by it's number?
Upvotes: 1
Views: 33