Robotic process automation

how to check whether the particular word is in the website or not. For example, if I want to check whether the particular country name is present in the website which contains all the country names.

Hi @nivetha_harsha
can you tell me the data in web side is in a structured format? if yes you can do data scrapping the data will goes in to the data table use for each row and access the column which contains the country name and use the condition StrVar.contains(“Countryname”).


In this page, if I want to select the country name Kenya, how could I do it?

do you want to click on it or want to extract it ?

if i am giving the input as Kenya, it should match that particular country name with all the names, and as a output it should correctly identify the given input and select it.

For this you can use a dyanamic selector

how could i use it?..Iam just a beginner

Check this posts




1 Like

@nivetha_harsha,

Take Click activity and click two countries individually show me selectors once and we need to check once.

Is it possible to access that site from my end ?

Yes, u can access it.
website name:w3newspaper

@nivetha_harsha,

Please find the attached workflow. It will select county based on your input country name.

Country_Test.xaml (10.9 KB)

And also one more solution is use Navigate To activity and pass below as string.

"https://www.w3newspapers.com/"+getCountry.ToString

Here, getCountry is your input country

Note: We should use Navigate To activity inside Open Browser or Attach browser activity. Else create one browser variable for either Open Browser or Attach browser and pass same to Navigate To activity.

If you have any doubts then please let me know.

bot.xaml (6.5 KB)
We are getting error …

@nivetha_harsha,

Why you deleted all declared variables in the workflow. Try below workflow. Don’t delete any variables.

Country_Test.xaml (12.7 KB)

thank you, sir…

@nivetha_harsha,

Have you tried above one and is it working for you ?

it’s working, but it causes the following error!! 123|621x273

@nivetha_harsha,

Could please attach the error screenshot. Am not able to see above error.

123
this error is obtained

@nivetha_harsha,

In that web page, every country name is starting with capital letter. Give input like this: India

Thank you @lakshman. I have gone through your code …but i didn’t get why you use getCountry.trim +" newspaper".

I have did the same without adding “newspaper” along with country name, it works fine for visible country but when country is not visible then it gives error.