Alejandro Espinel
Alejandro Espinel

Reputation: 91

XPath Need help getting part of href value preceding specific characters

I am trying to get the following information extracted out of a link using XPath, for example:

I have <a href="index.cfm?ag_num=470">LINK TEXT HERE</a>

I would like to select the href value of the link but only anything following ag_num=

So I would end up with 470 for the link above. Any ideas are truly appreciated, thank you!!

Upvotes: 0

Views: 36

Answers (1)

Andersson
Andersson

Reputation: 52665

You can use below XPath expression to get required value:

substring-after(//a/@href, "ag_num=")

Upvotes: 2

Related Questions