I am a Blue Prism novice and need help!
I am searching on some key terms in Google - when the first page results open, I want to have Blue Prism pick out the link titles which have "Key Term 1" and "Key Term 2" in the titles, then open the links. Meaning that, there could be a handful of results in the Google search results which may (or may not) contain the 2 Key Terms.
Is there any way I can do this in Blue Prism?
Yes, many different ways in fact.
Basic Solution:
First
Have the bot pass "Key Term 1" and "Key Term 2" into the Google search input box proceed by "allintitle:" and linked together with "AND". This will tell Google to only return results with "Key Term 1" and "Key Term 2" in the title.
The search will then look like this: allintitle: "Key Term 1" AND "Key Term 2" (Image Example)
This basically makes Google do the title work and saves you from having to grab the returned page and do a string value comparison between the titles and your key terms.
Second
Spy the appropriate on-page HTML location for the returned links in your Google Search objects Application Model.
The links themselves are held in the <cite class="iUh30">{URL}</cite>
HTML element, so your Application Model element will look something like this:
Tag - 'Equals' - CITE
Class - 'Equals' - iUh30
Index - 'Dynamic' -
Third
You can then pass in the number value of the index of the link you want the bot to click on in a Navigate stage. Should this be more than one just have the bot loop over the Navigate stage, but simply add 1 to the current index number before the end of the loop. In order for this to work you will have to setup your bot resources browser options to open links in a new tab, otherwise this will not work.
Another strategy you could pursue would be to have the bot grab the Google search return pages entire HTML and store it in a Data Item. You could then use the XML VBO to parse out everything but the returned links and then do with them as you please.
Grabbing the whole DOM and pulling it into Blue Prism is inadvisable though, as it's always bad practice to introduce the possibility of unknown live scripts being pulled in as well.