Download File from Yahoo
This sample downloads files from Yahoo Finance.
Steps to automate
- Open http://finance.yahoo.com/
- Search for a company (MSFT)
- Click "Historical Prices"
- Specify the date range
- Select "Weekly"
- Click "Get Prices"
- Download the file in the same folder as the workflow, with savedFile + timestamp as name.
- Close browser
Use Record Web and follow the previous steps.
When running the workflow we will receive an error when clicking "Get Prices" button. What happens!?
Well, looking at the Click 'Get Prices' activity we will notice that the selector property is:
<webctrl parentid='yui_3_9_1_9_1421166895519_46' tag='INPUT' type='submit' />
The parentid attribute is changing every time we access the page. We need to build a better selector in order to recognize that button. We use the UiExplorer tool in order to build a better selector. Uncheck the parentid attribute and check the aaname (which seems unique - "Get Prices").
The resulting selector
<webctrl aaname='Get Prices' tag='INPUT' type='submit' />
will do the job. We need to update the selector property of the activity in UiPath Studio and we're done.