0% found this document useful (0 votes)
2 views

Web data to write in the excel

The document outlines a bot that automates the extraction of product data from the Daraz website and writes it to an Excel file using UiPath. It details the activities and variables used in the process, including reading product names from an Excel sheet, opening a browser to navigate to product pages, and writing extracted prices back to the Excel sheet. The workflow is structured in a sequence that includes initializing variables, reading data, looping through product names, extracting prices, and saving the results.

Uploaded by

D.M.Kamrul Hasan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Web data to write in the excel

The document outlines a bot that automates the extraction of product data from the Daraz website and writes it to an Excel file using UiPath. It details the activities and variables used in the process, including reading product names from an Excel sheet, opening a browser to navigate to product pages, and writing extracted prices back to the Excel sheet. The workflow is structured in a sequence that includes initializing variables, reading data, looping through product names, extracting prices, and saving the results.

Uploaded by

D.M.Kamrul Hasan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Bot Name: How to Extract Web Data to Excel with UiPath

Bot Details:
This bot automates the process of extracting product data from the Daraz website and writing it
to an Excel file. The product names are read from the cells of a pre-created Excel sheet, and the
extracted data is then written back to the Excel sheet.

Activities Used:

1. Sequence
2. Excel Process Scope
3. Read Range
4. Open Browser
5. Write Cell

Variables Used:

1. excelPath - Stores the path of the Excel file.


2. productName - Stores the product name read from the Excel sheet.
3. productUrl - Stores the URL of the product page.
4. productPrice - Stores the price of the product extracted from the Daraz website.
5. dataTable - Stores the data read from the Excel sheet.
6. currentRow - Stores the current row index while looping through the data.

Step-by-Step Explanation with Example:

1. Sequence:

• Description: The Sequence activity is used to organize the workflow in a linear manner.
It ensures that the activities are executed in the specified order.
• Purpose: To provide a structured flow for the bot's activities.

2. Excel Process Scope:

• Description: The Excel Process Scope activity is used to open and interact with Excel
files. It provides a scope within which all Excel activities are performed.
• Properties:
o Workbook Path: excelPath
• Purpose: To open the Excel file containing the product names and perform read and
write operations within this scope.
Example:

plaintext
Excel Process Scope
Workbook Path: "C:\Path\To\Your\ExcelFile.xlsx"
-> Activities inside the scope

3. Read Range:

• Description: The Read Range activity is used to read data from the specified range of
cells in an Excel sheet. The data is stored in a DataTable variable.
• Properties:
o Range: The range of cells to read (e.g., "A1:A10").
o Output DataTable: Stores the read data (stored in dataTable variable).
• Purpose: To read the list of product names from the Excel sheet.

Example:

plaintext
Read Range
Range: "A1:A10"
Output DataTable: dataTable

4. Open Browser:

• Description: The Open Browser activity is used to open a web browser and navigate to a
specified URL.
• Properties:
o Url: The URL of the Daraz website (or specific product page, stored in
productUrl variable).
o BrowserType: Type of browser to open (e.g., Chrome, Firefox).
• Purpose: To open the Daraz website and navigate to the product page.

Example:

plaintext
Open Browser
Url: productUrl
BrowserType: Chrome

5. Write Cell:

• Description: The Write Cell activity is used to write data to a specified cell in an Excel
sheet.
• Properties:
o Range: The range of cells to write (e.g., "B1").
o Value: The value to write (e.g., productPrice variable).
• Purpose: To write the extracted product prices to the Excel sheet.
Example:

plaintext
Write Cell
Range: "B" + (currentRow + 1).ToString
Value: productPrice

Workflow Steps:

1. Initialize Variables:
o excelPath = "C:\Path\To\Your\ExcelFile.xlsx"
o productName = ""
o productUrl = ""
o productPrice = ""
o dataTable = New DataTable()
o currentRow = 0

2. Excel Process Scope:


o Read Range:
▪ Read product names from the specified range (e.g., "A1:A10") into
dataTable.

3. Loop Through DataTable Rows:


o For each row in dataTable:
▪ Assign productName = row("ProductNameColumnName").ToString
▪ Construct productUrl using productName (e.g.,
"https://www.daraz.com.bd/catalog/?q=" + productName)

4. Open Browser:
o Open the browser and navigate to productUrl.

5. Extract Product Price:


o Use web scraping techniques to extract the product price from the Daraz website.
o Assign productPrice = Extracted product price.
6. Write Cell:
o Write productPrice to the corresponding cell in the Excel sheet (e.g., "B" +
(currentRow + 1).ToString).
o Increment currentRow by 1.

7. Close Browser:
o Close the browser.

8. End Excel Process Scope:


o Save and close the Excel file.

You might also like