Web data to write in the excel
Web data to write in the excel
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. 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.
• 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
4. Open Browser:
o Open the browser and navigate to productUrl.
7. Close Browser:
o Close the browser.