Prerequisite: How to Install UIPath Studio Community
In this article, we will learn how to make a simple project using Data Scraping in UiPath Studio. This is a simple application of Robotic Process Automation in which information is extracted from a webpage, get written and stored in an Excel sheet, and then the file is sent to the desired email address. The whole process is automated using RPA.
Note: Depending on the web table from which you are extracting the data create a blank Excel sheet with the same column names and save it. Also, the below task can be performed on UiPath studio X version.
Below is the step-wise approach to develop an RPA project using Data Scraping in UiPath Studio:
Step 1: Open the Uipath Studio and create a new process by clicking on the Process tab.
Step 2: Set the name of the process and give a short description then click on Create.
The Uipath studio will automatically load and add all the dependencies of the project. The design page will get opened, click on OPEN MAIN WORKFLOW.
Step 3: Now in the activities panel search for Flowchart activity. Drag and drop it in the designer window.
Step 4: Now in the activities panel search for Open Browser activity. Add it to the sequence. Double-click on it and pass the URL in quotes. Let’s search for Covid live data.
In the properties section, under Input tag select BrowserType as chrome, and under output tag create a UiBrowser variable browserVar by pressing ctrl K.
Step 5: Click on the Data Scraping icon in the design tab.
The Extract Wizard window will get opened.
Now open the URL in the browser as mentioned in the wizard and click on the Next button. Click on any single field in the table, a window will appear asking if you would like to extract data from the whole table, click on YES.
You will see a preview table on the screen, enter 0 (for selecting all) in maximum no. of columns and click on the finish button.
A window will appear asking Is data spanning multiple pages? Click No.
Connect the Data Scraping activity with Open Browser activity. Double-click on DataScraping activity and then click on variables at the bottom you will see that a variable ExtractDataTable has been created with variable type datatable and scope DataScraping.Change the scope to flowchart.
Step 6: Now search for message box activity in the Activities panel. Drag and drop it in the designer window. Pass the message in quotes by double-clicking on it “Data extraction Completed”.
Step 7: Now in the activities panel search for Excel Application Scope activity. Drag and drop it in the designer window. Pass the location of the Excel file created before in quotes. Now search for Write Range activity and drop it in the do section. Change the cell from A1 to A2 and in the data table field pass the ExtractDataTable variable.
In the properties, panel makes sure to uncheck the “Create If Not Exist” option as we have already created an excel file.
Step 8: Now search for message box activity in the Activities panel. Drag and drop it in the designer window. Pass the message in quotes by double-clicking on it “Data writing process Completed”.
Step 9: Now search for Send SMTP Mail Message activity in the Activities panel. Drag and drop it in the designer window.
- In the “To” field, write the email id of the recipient to whom the excel file has to be mailed automatically.
- In the “subject” field, write the desired subject for example “Covid 19 Report”.
- In the “body” field , write the message for example “Hi please find the attachment report”.
Click on Attach files and then create an argument, in the value field pass the location of the Excel file in quotes, and click OK.
Now click on the ‘arguments’ panel and create 2 arguments named Email and Password and in default values write the email address and password of the sender’s email from which the report has to be sent.
In the properties panel, under the host section write PORT as 587 and SERVER as “smtp.gmail.com”, under Logon section in email and password pass the above-created Email and Password arguments, under Receiver section Bcc and Cc fields are optional no need to add them and in the To field, you are already given the receivers address, under Sender section – in From field pass the argument Email (above-created argument having the email address of the sender) and in the name field write the Name.
Step 10: Now search for close tab activity in the Activities panel. Drag and drop it in the designer window. Click on this activity and in the properties panel under the input section pass the browser variable browserVar.
Connect all the activities and save the process using the Save button in the design panel and then click on Run. Your bot is ready!
Note: If you face any error in sending mail go to your Gmail account security settings and turn on LESS SECURE APP ACCESS.
If you follow the above steps your flowchart will look like this:
In this way, one can easily develop an RPA Project using UiPath Studio.