Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xpath Get Full URL by combining a base URL with a string obtained from Xml

Tags:

xml

xpath

I am getting a url form a HTML Page with this Xpath:

//*[@id="page"]/div[1]/table/tr[9]/td[2]/a/@href

This code Output show link like this

href="test/306811.zip"

I want add site domain to outupt like this:

href="http://domain.com/test/306811.zip"

How can do this ?

like image 722
alireza Avatar asked Oct 20 '22 13:10

alireza


1 Answers

Use concat or string-join, e.g.

concat('http://domain.com/', //*[@id="page"]/div[1]/table/tr[9]/td[2]/a/@href)
like image 87
StuartLC Avatar answered Nov 15 '22 10:11

StuartLC