Searching for Text in Webpage and Returning a Boolean


Very new to UI-Path with some programming background.

I have a list of URLs in which I want to search for a specific text. This text does not have a specific element and might be anywhere in the webpage. For this purpose I figured the best activity would be to use “Text Exists”.

I tested it with the this link and searched for the word “Random” which is at the bottom of the webpage.

I noticed that I get a False if I do not scroll down to where the word is, but when I do, I get a True. Below are screenshots for the 2 runs and the results in excel.

Scenario1 Result

Scenario2 Result

Below is the element I selected:

Again, no change done on the program, I just scrolled down when the browser was opened to get a “True” result. Isn’t the program supposed to search the entire webpage regardless?

Main.xaml (10.0 KB)

Thanks in advance!

Hi @mostafa.assaf,

One workaround to your problem is to use the Get Full Text activity, as follows:

It works even if the text is not visible.

UiPath seems to provide us with a vast amount of options for data scraping. We just need to try and see what fits the most for a certain case.

Hope this helps
Best regards,

If it only works if the text is already loaded. Many webpages nowadays do not load the full content. You have to scroll down until the size of the text do not increase any more.

Hello @Marius_Puscasu,

Will give that a go and update you :slightly_smiling_face:

Totally agree on the diversity of options available and I hope to get the most out of all !