Problem with web data scrapping

While Scraping the data from a web page(Flipkart, Amazon) my code works for the grid view ones(SINCE I DID SCRAPING FROM GRID VIEW PAGE) and fails for list view ones. How do I differentiate in my code for list view and grid view?
I am taking input from the user, depending on input the webpage could be either list or grid.

Hello @sunain_chahar ,

Welcome to @uipath Community.

It can be done in 2 ways on how you wanna configure it.

  1. If you need your code to work for both Grid view and List view, then you shall Extract the details for both the views and based on the user input(as you have mentioned) the code shall work either ways.
    A simple Switch Activity or IF will do this.
  2. If you require the process to work only on Grid view, configure within your code to change the View to Grid in the webpge and then continue with data extraction.

Hope this helps !

Thanks,
Jeshwanth

Hi

Welcome to uipath forum

  1. As you are getting the input from user whether it is a list or grid, save it in a variable of type string named Strinput

  2. Now use a IF condition like this

Strinput.ToString.ToUpper.Contains(“LIST”)

If true it will go to THEN block where use a extract datatable activity or if it fails to get it in list view then use SCREEN SCRAPPING method which will give output as string which we need to pass to GENERATE DATATABLE activity which will give us datatable as output

If false it will go to ELSE part where use your current Extract datatable activity to get the grid view of table from web page

Hope this would help you resolve this

Cheers @sunain_chahar

Thanks for the help i’ll try this method.

Thanks. Please post the updates and please mark the relevant update as solution, if resolved.

Happy automation.