Highlighting Regex Match

I am using Get Full Text to scrape the text off a webpage and then using Is Match to create a regular expression and check the scraped text to see if there is a match. Is there an easy way to highlight the match on the webpage if there is one found? My boolean is returning true but I want to be sure exactly where the match is being found.

Thanks

I think if that is a webpage with text in it, it would be hard to highlight using Highlight activity of UiPath, that would require creating a generic selector and passing the found match in that. Would require creating that generic selector for any text in that section where you are getting the scraping done.

alternatively, you can get the match and then find in the page if that suits the requirement.

You can do this by using Highlight Activity, as @rahulsharma suggested you have to create a most generic selector and pass the matched value to the activity’s selector in a For each loop.

Another way is simply using hotkeys and search the word on the webpage.

As an alternate maybe highlighting on browser level will serve your needs:

used within an invoke JS Script activity against the browser page

Another option could be to automate the browser search funtionality
F3
Type In SearchTerm
Alt + v (check your locals)
grafik
etc

1 Like

Hi,

We can use System.Text.RegularExpressions.Capture class to find position index and length of the match.

The following is a simple sample, FYI.

This sample outputs the following html.

img20211004-2

Sample20211004-2.zip (2.3 KB)

Regards,

1 Like