-1

I would like to catch by an XPath expression the href of the second link, the one containing the span for example in this :

<a class="test" href="1">hey</a>
<a class="test" href="2">
    <span>blabla</span>
</a>

Thanks by advance!

asa
  • 431
  • 4
  • 19

1 Answers1

1

You can just use the [ ] syntaxe using parentheses around the span : //a[(span)]/@href

Ayra
  • 308
  • 2
  • 12