| T56 - Extract data from a web page |
| Task Description |
Extract tabular data from any web page. For example we will be extracting all sample tasks and their description from Automation Anywhere Website.
T56.atmn
Note: Save the .atmn file in My Documents -> Automation Anywhere -> Automation Anywhere -> My Tasks
|
| Solutions |
 |
Create a new task
- Click on New - > Task Editor
|

Screenshot 1

Screenshot 2

Screenshot 3

Screenshot 4

Screenshot 5

Screenshot 6
|
 |
Capture the table
- Under Internet category double click on Web Recorder command.
- Select the command Extract Table. Enter the website link which contains the tabular data (for e.g. http://www.automationanywhere.com/support/examples.htm) and click on launch.
- After the web page is loaded, click on capture button. A yellow tip appears with the text "Please click on the table you want to capture." In the webpage, click on the table you want to import.
|
 |
Save the table data to .csv file
- Once the table is captured, specify a valid path and a file name with .CSV extension and click on Save. Screenshot 2
- You can now open the .CSV file in Excel or many other programs.
|
 |
Transfer all table date to another application (Optional)
Above steps gets all the data in .CSV file but alternatively you can get the web data one by one in loop and perform additional actions on it. Let's say you want to dig into the links listed and get the data from details webpage and put them in a notepad or text file (for simplicity) in specific format.
- Under the ‘Conditions /Loops’ command category, double click on Loop command. Select the option "Each row in an Internet Explorer Table" and click on Save. Screenshot 3
- Inside loop, insert ‘Manage Web Controls’ Web Recorder command to click on link in particular column for e.g. Table Column(2) in this case. Just double click on Web Recorder command, select ‘Manage Web Controls’ option, specify the URL, click on Launch button and capture the first link in the list using ‘Capture’ button. Click on ‘Advanced View’ and replace the actual Caption with system variable, Table Column(2). You can hit F2 to select the variable. Screenshot 4
- Insert ‘Extract Data’ command to capture the data from details page. Double click on Web Recorder command, select ‘Extract Data’ option, specify the URL, click on Launch button and capture the data you want to extract. You can store the extracted data into any user variable by selecting the variable from drop-down in Step2 of Extract Data command. Screenshot 5
- To save the data in a text file, from ‘Programs/Files/Windows’ command category, double click on ‘Log to File’ command. Specify the path of text file in ‘Log File’ textbox. Select the variable you want to save using F2 Key. Screenshot 6
- Insert ‘Go Back’ web recorder command to return to main page having list of links.
Note: To have proper spacing, insert a tab between each column.
Keystrokes: $Table Column(1)$[TAB]$Table Column(2)$[ENTER] in "Untitled - Notepad"
|
 |
How to run the task:
- In case you do not have Automation Anywhere installed, please download and install it from, http://www.automationanywhere.com/download/freeTrial.htm
- Save T56.atmn under location, My Documents\Automation Anywhere\Automation Anywhere\My Tasks
- Launch Automation Anywhere and from Task List select T56.atmn and click on RUN button to run the task.
|
|
When you run this task, it launches the website and gets all data in CSV file or optionally it loops through all the rows and columns of the table to get into the link on main page and extract the data from details webpage to print it in a notepad. Screenshot 1
Note: You can also use the pre-defined Template 'Extract Tabular Data from a Web page' |
|
 |
| We started using this product to copy data from legacy system to new system. Now we use it just to do about anything automated. Countless hours saved. Thank you guys. |
- Jack Greenberg
|
| Read Customer Testimonies >> |
|