Read and Review Automation Anywhere Documentation

Automation 360

Close Contents

Contents

Open Contents

Example of extracting data from a web table

  • Updated: 9/27/2021
    • Automation 360 v.x
    • Build
    • RPA Workspace
    • Examples

Example of extracting data from a web table

Build a bot to open a browser window to the Wikipedia website, extract the data from a table, and write it to a CSV file on your desktop. This example uses actions from the Browser, Data Table, Recorder, and Window packages.

To extract data from a table, do the following steps:

Procedure

  1. Open a new bot:
    1. On the left panel, click Automation.
    2. Click Create new > Bot.
    3. In the Create Task Bot window, enter a bot name.
    4. Accept the default folder location \Bots\.
      To change where your bot is stored, click Choose and follow the prompts.
    5. Click Create and edit.
  2. Open a browser window to the web page from which you will extract the table.
    1. Double-click or drag the Browser > Open action.
    2. In the URL field, enter https://en.wikipedia.org/wiki/Table_(information).
    3. Select your preferred browser.
    4. Click Save.
    5. Click Run.
      The bot opens the window.
  3. Specify the table.
    1. Double-click or drag the Recorder > Capture action.
    2. Click the Window tab and select the Table (information) - Wikipedia window from the drop-down list.
      If the window title does not appear in the list, click Refresh.
    3. Click Capture object.
      The Table (information) - Wikipedia window activates.
    4. Hover over the Age table below the Basic description heading.
      An orange box appears, surrounding the table.
    5. Click the table.
      The Object Processing message box appears.
    6. Return to the Control Room.
    7. In the Object properties table, verify the Control Type is TABLE.
      If it is not, click Recapture object.
    8. From the Action drop-down list, select Get table.
    9. In the Assign output to variable field, create the Tabledata variable.
    The Table (information) - Wikipedia window is saved as the variable window-1.
  4. Specify the file where to save the data.
    1. Double-click or drag the Data Table > Write to file action.
    2. From the Data table name list, select Tabledata.
    3. Provide a file path to create a CSV file.
      For example, C:\Users\<username>\Desktop\WikipediaTable.csv.
    4. Select the Create folders/files if it doesn't exist option.
    5. Select to overwrite the existing file.
  5. Close the Table (information) - Wikipedia window.
    1. Double-click or drag the Window > Close action.
    2. Select the Variable tab and insert window-1.
  6. Click Save.
  7. Click Run.
    The bot creates a CSV file on the desktop with data on seven indexes, their values, and net change.
Send Feedback