Resources

Knowledge Base

Download File from Yahoo

recording

 

 

Task

This sample downloads files from Yahoo Finance.

Steps to automate

  1. Open http://finance.yahoo.com/
  2. Search for a company (MSFT)
  3. Click "Historical Prices"
  4. Specify the date range
  5. Select "Weekly"
  6. Click "Get Prices"
  7. Download the file in the same folder as the workflow, with savedFile + timestamp as name.
  8. Close browser

Solution

Use Record Web and follow the previous steps.

Note

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.

uiexplorer