(v6 of the guide - updated script according to Robin v 0.9.2)
By utilizing UISpy we can extract various information not only from our desktop/apps but also from the web.
All (if not most) of web related actions are part of the WebAutomation module.
I am going to use the URL burque505 tried extracting data from.
Go to this website.
Then launch UISpy.
Click on Add Control.
Position your mouse over an element of the United States table.
Hold Ctrl + Shift and scroll down until you have selected the table element.
Then hold Ctrl and left click in order to capture the window element. Hit done.
Note that I have renamed the .appmask file, the application name, the window name and the selector for convenience.
Click on Edit Selectors option.
Note: You can always modify your selectors through the selector builder.
The default selector will be sufficient in most cases, such as this one.
The best approach is to first experiment with the default(initial selector generated by UISpy) and then modify it according to your needs.
Just to showcase the mods, I have included the whole path (from the body and downwards), and excluded all the class attributes except the one belonging to the table element at the bottom.
If you make any changes you can save them by clicking Update.
To follow the guide step-by-step leave the selector as it was generated.
Open Robin’s editor.
When using .appmask files we have to import them.
It is mandatory to use the import command at the top of your Robin script.
Now we have access to the selectors we have created.
To reference a selector the syntax goes as follows:
[name of the .appmask file].[name of the application you are extracting data from].[screen/window name].[control name]
In case you want to reference it multiple times in your script it is a good practice to store it in a variable.
Create a variable to hold the URL and then launch a browser instance.
Use the WebAutomation.LaunchChrome action and pass the Website variable as an input:
After that we can use the .ExtractHtmlTableInExcel action to extract the table we want and write the retrieved data to an excel instance.
Finally we save the excel file, terminate the excel application and close the browser.
By navigating to the folder you declared, you will see that a new .xlsx file has been created.
Open it and you will see the extracted data.
Here is a screenshot of the whole Robin script: