i want to search mutliple words in webpage using hot key(ctrl+f) and find whether that word exist or not and get the number of occurrences of word…
And what problem did you encounter? It is pretty straightforward to me:
- Send Hotkey : Ctrl+F
- Type into (the search bar): your string
- Get Text where it’s usually written “occurence X of X” or “not found”
- Depending on the String you got, you can set a True or False value to a boolean such as wordPresent
- If wordPresent is True, extract the number X from the String and put it in an Int32 variable
get text or get ocr text is not working for that pop up(find box).
Get the text by using Get full text activity and store it in a variable stra
Replace Newline with empty value
Use For each activity to loop the words which you have to search
Use below mentioned in for each
Let us take we have to find the number of occurences of strb in stra
then use one assign activity
int a = System.Text.RegularExpressions.Regex.Matches(“stra”,“strb”).Count
This will give the count of occurences.
If count is greater than zero , the word exists else no, and the count is number of occurences
Note: Replace the strb with item.ToString of foreach while looping
for my web page ‘get full text’ is not working . i tried getting the data from web page using OCR but that data is not accurate even after trying with various scale values.