It seems nime5ter and I both had the same idea. Here is a solution that is based on what we did separately. When I started, I tried to adapt the excellent start that Kalle made, but it was not possible using scrape alone. Eventually we ended up with this which is quite different, and relies only on a payloadXml command for selecting results after the search.
Make sure the RoboB plugin is enabled before trying to use this XML.
You start by asking: "search for THING"
and then you can either say: "select result number 3" or "select result LINKTEXT" where LINKTEXT is what is shown in blue by google's result page.
It only uses major link results, not all the ads and subdomain results that you see at the top. If someone wants to modify it to cover all the possible links that would be great.
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.4.8-->
<groupCollection open="True" name="Web Search with RoboB and Google">
<commandGroup open="True" name="Google search and scrape" enabled="True" prefix="" priority="0" requiredProcess="" description="">
<command id="364" name="google search" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>TTS.Speak</cmdType>
<params>
<param>searching for {1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>RoboB.Select</cmdType>
<params>
<param>Google</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>RoboB.Navigate</cmdType>
<params>
<param>https://www.google.ca/search?q={1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>RoboB.Wait</cmdType>
<params />
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>RoboB.Show</cmdType>
<params>
<param>True</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>RoboB.SetWinSize</cmdType>
<params>
<param>1200</param>
<param>1000</param>
<param>390</param>
<param>5</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>RoboB.ElementByID</cmdType>
<params>
<param>rso</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>RoboB.GetHTML</cmdType>
<params />
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.RegEx</cmdType>
<params>
<param><h3\sclass="r"><a.onmousedown=.*?href="(.*?)">(.*?)</a></h3><</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>PayloadXML.Clear</cmdType>
<params>
<param>payloads\GoogleSearch.xml</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<loop>
<loopParams>
<from>1</from>
<to>{#M}</to>
</loopParams>
<loopActions>
<action>
<cmdType>PayloadXML.AddPair</cmdType>
<params>
<param>payloads\GoogleSearch.xml</param>
<param>{Match.{j}.1}</param>
<param>Number {j}</param>
<param>False</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>PayloadXML.AddPair</cmdType>
<params>
<param>payloads\GoogleSearch.xml</param>
<param>{Match.{j}.1}?</param>
<param>{Match.{j}.2}</param>
<param>True</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</loopActions>
</loop>
<action>
<cmdType>Group.Rebuild</cmdType>
<params>
<param>google results by payload xml</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>search for, google search</phrase>
<payloadDictation>payloadDictation: Regular</payloadDictation>
</command>
<command id="245" name="close search results" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>RoboB.Select</cmdType>
<params>
<param>Google</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>RoboB.Dispose</cmdType>
<params />
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>close search results</phrase>
</command>
</commandGroup>
<commandGroup open="True" name="google results by payload xml" enabled="True" prefix="" priority="0" requiredProcess="" description="">
<command id="410" name="select result" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>TTS.Speak</cmdType>
<params>
<param>opening {PF.1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Launch.OpenURL</cmdType>
<params>
<param>{1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>select result</phrase>
<payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\GoogleSearch.xml</payloadFromXML>
</command>
</commandGroup>
</groupCollection>
In the process of making these commands I discovered some small things that will be improved in the next release of VC.
In the main program, payloadXML files won't work as expected if two payloads have exactly the same value. I did this on purpose back in the day but now I realize that there are valid reasons for allowing it. As a work around I added a ? to the end of the value for the title based URL. (You need to look at the macro to understand what I'm talking about.)
In roboBrowser I'm going to improve the focusing of the browser window to make it easier to send the RoboB keyboard emulation, and I'm adding actions to scroll the window.