Check if two websites are same

Hi,

I am having two websites as below,

website1 - f1.com
website2 - formula1.com

I need to check if either of the two website is redirecting to other website. For example, in above case, f1.com is redirecting to formula1.com.

Currently I am checking it by launching both websites in chrome and checking if either of the websites is redirecting to other website using “Get Attribute” activity. However I am having thousands of such pairs of websites and above approach is taking lot of time.

Can anyone please advise if there is a better way of checking it? We can use any other applicable attribute for this check also(example - IP address).

Thanks,
Kapil

Hey @Kapil

We can use the HTTP activity from the UiPath.WebApi.Activities pack to perform the same check in a quick background way.

Kindly explore and if you need more help feel free to post.

Thanks
#nK

Hi @Nithinkrishna , I had checked with HTTP Request activity but no luck. While I am getting “formula1.com” text in response data after making get request on “f1.com”, however the response data is not in a structured format.

Also don’t want to do contains match ‘ResponseData.Contains(“formula1.com”)’ as this method won’t be foolproof.

Thanks,
Kapil

Hey @Kapil

It’s not like string contains match. The matching can be done in many ways.

Response data, Response status, URL, etc

Is the f1.com and formula1.com real example to play with ?

Thanks
#nK

Hi @Nithinkrishna,

No, f1.com and formula1.com are not the real examples. I won’t be able to provide real examples due to security reasons.

However there are not constant sets of websites which we have to check. We will have new sets(in the order of hundreds) during each run.

Incase there is any generic and reliable approach for f1.com and formula1.com then we can try implementing that for other websites also.

Thanks,
Kapil

can you check if the strategy of detecting redirects will match your case?

EDIT:
Using target framework: Windows, VB.Net


grafik

myResponse = myHttpClient.GetAsync(myUrl)

From the result we can check the status code, comparing the location info:
grafik

Hey @Kapil

So one way is to match the response content of the two URLs

As you want to check if the website loaded with same content for both.

Thanks
#nK

Hi @ppr and @Nithinkrishna , many thanks for your inputs.

I will check on suggested approaches and will keep you posted.

1 Like

Hi @ppr, can you please advise if it is possible to check redirect in Uipath.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.