-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
  • 531
  • 1
  • 5
  • 20

1 Answers1

1

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

Ayra
  • 328
  • 2
  • 12