go to a website and search for company names
Extract market Cap and current price for each company
Write the extracted value to excel.
Excel should contains 3 columns. Comapany name, market Cap and current price. what to do if a company name is not present in the screener website. and also do a modification on this
Retry the entire solution twice if any unexpected error occured
Dont use retry scope activity and instead of that, use the logic for retry
If the error persist after 2 retry, then write the exception in the sheet ‘Exceptions’ (same excel).
Exceptions sheet should contains 2 columns . company name and exception reason.question
Hi
Hope the below steps would help you resolve this
- Initialize variables in variable panel
CompanyNamesList with default value as New List(of String) from [“Bajaj Auto Ltd”, “NTPC Ltd”, “NTT DATA”, “Gail Ltd”, “Nu Tech Organic Chemicals Ltd”, “Vodafone Idea Ltd”, “Zee TV”]
OutputDataTable with default value as New System.Data.DataTable
Then bring three add datacolumn activity to add each of the columns named
-“Company Name”
-“Market Cap”
-“Current Price"
- Use a. For Each activity where pass the variable CompanyNamesList and change the type argument as string in property panel
Inside the loop
a. Open a web browser and navigate to the screener website.
b. Use a text input field to enter the company name (companyName) in the search box.
c. Use a click activity to trigger the search.
d. Use a conditional statement or element existence check to verify if the company data is available on the page:
-
If the company data is available:
-
Use web scraping activities to extract the market cap and current price.
-
Add a new row to OutputDataTable with the extracted data using ADD DATAROW activity where pass ArrayRow property as
{companyName, extractedMarketCap, extractedCurrentPrice}
And datatable name as OutputDataTable
-Continue to the next iteration of the loop. -
If the company data is not available:
-
Add a row to OutputDataTable indicating that the data is not available for this company with same add Datarow activity with property ArrayRow as
{companyName, “Data not available”, “Data not available”} -
Continue to the next iteration of the loop.
e. Close the web browser.
-
After the loop is complete:
- Use an Excel Write Range activity to write the data from OutputDataTable to an Excel file.
- Specify the Excel file path and sheet name.
-
End the workflow.
This pseudocode outlines the main steps for your scenario. You will need to use UiPath activities to implement each step in detail.
Hope this helps
Cheers @HASNA_HANEEF
thanks for the response