Check Href link exists or not

Dear All,

Am having output in data table, from this data table I want to check each row consists valid href link. If href link exits need to click that and certain operation to be done. Or if the link doesn’t exists another operation to be done. I would like to know how to check particular row contains href links or not. Please help me out the same.

Thank you,
Gokul

Hi @gokulvasant ,

Use Http Request Activity
In Properties
Input->EndPoint ->Give the Url here (row value)
Input->Method->Head
Output->StatusCode-> create int variable (intvalid)
if intvalid is equal to 200
then valid url
else invalid url.

For reference
validate site url.xaml (5.6 KB)

Regards,
Arivu

1 Like

If you know the column name which contains href, you can bifurcate using DataTable Select and get the ones with link in one DT/no links in another DT and perfrom your operations.

dtLinks = dtTbl.Select("[ColName] Like '%href%').CopyToDataTable

Then perform above step provided by @arivu96 to check the validity.

Hi ,

What if i have list of urls and i need to validate Them.

Hi,

I know status code 200 implies for valid url.
If suppose i land to a webpage of a specific website and it gives me an error as “Page Not found” ?
In this case also the code is 200 for valid url but i am also getting 404 which is page not found
How do i extract the 404 code from this one?