Data append issue while scrapping from Website and writing data into excel file

Hello,
I am having issue of data getting appended into second excel sheet while writing data into excel sheet using Write Range activity for data scrapped using Extract DataTable using Uipath.
The problem statement is that I need to click each symbol name in Nifty 50 Gainers Tab and Navigate to Quotes Page for respective symbol. And Next step is to scrape the data from Quotes page for respective symbol and store into the excel file. Then again Navigate back to Nifty 50 Gainers Tab and click next symbol name and again Navigate to Quotes page for that clicked symbol name and Again scrap the Quotes data for respective symbol name and write the data into excel file using Write Range Activity using Uipath.
But the issue that I am currently facing is that, I am able to click each symbol name in Nifty 50 Gainers tab and getting properly navigated to Quotes page for respective symbol. Also I am able to click back and Navigate back to Nifty 50 Gainers Tab as well.

For example I am clicking [BAJAJFINSV] symbol name in Nifty 50 Gainers tab in NSE Live Market website. Then Quotes page gets opened for BAJAJFINSV symbol. I am scrapping data from Trade Snapshot and store in excel file as single sheet named Gainer-Bajaj Finsv.
Then I am clicking back button and Navigate to Nifty 50 Gainers Tab in NSE Live Market website and clicking second symbol name from the table which is [BAJFINANCE] and again Navigate to Quotes page of respective symbol name and again scrapping data and storing data into excel file as second sheet with Gainer- BAJFINANCE in excel file. But the issue is that I am getting data of BAJAJFINSV appended into BAJFINANCE sheet. Attached screenshot for reference. But my requirement for the process is that I need separate excel sheet for separate Quotes data for respective symbol name, means BAJAJFINSV and BAJFINACE sheet should be separately stored in different sheets in same excel file. Also same should be followed for all symbol name of Nifty 50 Gainers Table in NSE Live Market Website. Please help me out with this issue.

I am also able to scrape the Quotes (Trade Snapshot) data for each respective symbol as well and store into excel file. But the issue is that Quotes data (Trade Snapshot) of first symbol name is getting appended into second sheet in excel file using Write Range activity and Extract DataTable activity. I have used row count to check the datatable count before writing data into datatable but the issue is that Trade Snapshot data of the first symbol is getting appended into second sheet for Trade Snapshot data for the second symbol name in excel file.

Please anyone, help me out with this issue on urgent basis. I am sharing the excel file and screenshot for reference.

NSE_Data_19012021_1217.xlsx (13.4 KB)

PFA
Regards
Rohit Lanjewar

Hello @rohit.lanjewar

This is because the data scrapping is not working for the second part and due to continue on error property is set on data scrapping activity it returns with no data extracted without giving error.

Since the data table got the values from previous page so it would keep on giving the details of first page again and again.

You can check this by setting the continue on error property to false and an exception would be thrown.

1 Like

Hello Nilay,
Thanks for your prompt response. I have checked the Continue on Error property of Extract DataTable it was set to True. Now I have changed the Continue on Error property to False for Extract DataTable. But the issue is same I am getting data appended of first symbol name into second symbol name sheet in same excel file. Also row count is changed to 24 for scrapped data of Trade Snapshot for second symbol data. First row count was 12 and now the count is changed to 24.
Please help me out with this issue. Please find the attachment for the excel file and screenshot of the process. It would be great help for me, if you share any working demo for the process.

NSE_Data_19012021_0210.xlsx (14.4 KB)

PFA
Regards
Rohit Lanjewar

Regards
Rohit Lanjewar

Hi @rohit.lanjewar

After writing scraped data table into excel sheet., means after write range activity., clear same DT with the help of clear data table activity.
So previously present data will get cleared and in next read new data will there to write.

1 Like

Hello Neha,
Thanks for your prompt response. I have used Clear DataTable after Write Range Activity. The solution is working fine. I am getting separate sheet data for Trade Snapshot for each symbol name. Please find the attached excel file output.

But there is another issue that the Back button is getting clicked in the Quote page and Quote Page getting navigate to Nifty 50 Gainers Tab page and again process of Clicking each symbol name and Navigate to Quote page is getting started. Again scrapping of the Trade Snapshot data for each symbol name is getting done.

My requirement for the process is that process should get navigated back to Nifty 50 Gainers tab in Live Analysis page from Quotes page after all symbol names Quotes data is scrapped and stored into excel and same process should not start again. I have used Reframework for my process.

For example For each symbol name from Nifty 50 Gainers Tab should be clicked for first time and Trade Snapshot Data for respective symbol name should be scrapped into separate sheet which I am currently getting in excel file. Again last process should be Click on Back Button in Quotes Page for last symbol name of Nifty 50 Gainers Table and Navigate to NSE Live Analysis page and process should get stopped.

Please help me out with the issue. I am attaching screenshot for your reference.

NSE_Data_19012021_0252.xlsx (17.0 KB)

PFA
Regards
Rohit Lanjewar

Hello Rohit,

This is happening because the way you did looping into the code.
Till extract all the values form Nifty grainers, losers & most active value it’s working as expected.
Now while extracting data table of each symbol how you are doing into the code that is the question.

We know that gainers tab present symbol value might be different like 5 or 6.
so just perform data scarping there, then use for each row activity for same data table.

Inside it perform extraction operation of each symbol., below steps should be inside for each data row loop.

Click on symbol
Extract DT
Write DT into excel sheet
Clear DT…

so one by one bot will work for available symbols only and once all symbol data extraction completed., process will get stop.

1 Like

Hello Rohit,

Does solution worked…??

Hello Neha,
I am trying with above solution. Please find attachment for my process workflow. I am also using find children activity in my workflow.
Please suggest me changes in my workflow for the condition. Also please do check the Process file that I have shared and Do let me know whether the file is getting opened properly or not.

NSE_IN~1.ZIP (12.1 KB)

Regards
Rohit Lanjewar

Hi Rohit,

Please find attached workflow for your reference.

Test.xaml (13.3 KB)

1 Like

Hello Neha,
Thanks for your solution. I will try it first and then implement it in my workflow and let you know, whether it works or not.

Regards
Rohit Lanjewar

Hello Neha,
The workflow that you have send is running individually properly. But when I try to implement complete process in my workflow. It is not running fine. Again the Process of Clicking Symbol name in Nifty Gainers and Navigation to Quotes page and Data Scrapping of Trade Snapshot for each symbol name is executing for second time as well.
It means it completes the process of clicking on each symbol name in Nifty 50 Gainers Tab and Scraps Trade Snapshot for each Symbol name Navigates back to Nifty 50 Gainers Tab page.
And process of clicking each symbol name from First Symbol in Nifty 50 Gainers Tab Page and Scrapping of Trade Snapshot of each symbol occurs again.
And lastly process is not stopping after scrapping of last Trade Snapshot data for Symbol name in Nifty 50 Gainers Tab.

Please find the attached workflow for reference. And Please suggest required changes that needs to be done. So that the process gets executed properly.

NSE_IN~1.ZIP (10.5 KB)

PFA
Regards
Rohit Lanjewar