Data Scraping from multiple browser sessions

Hi, need some assistance here.

Scenario - Need to capture the price of a product on a website by opening one browser at a time and use data scraping to capture the data and extract into excel.
Ex: search for laptop price in one browser and open another browser and search for price of phone and so on and on, depending on the no.of entries in excel. When all search requests are completed, capture the data retrieved (Price) for all the products (Across all browsers) into excel. I have been using dynamic selector as the price is dynamic

Issue: Output excel has captured the price of first product correctly into excel. When second product was searched, it created same entry in excel that was executed in first browser. So, i am not able to understand why it is creating same entry although search results were different everytime new browser is executed. I am executing same url in multiple browser sessions.

Also, is there a way we can execute each condition in different tabs in chrome rather than opening new browser every time for testing each condition.

Hi @TharUI,

Have you used counter for increment

@TharUI,
After extracting first product from chrome then close the tab.that would close first instance and so that same entry are not there.
or
use navigate url activity in loop after every search url is refreshed in same tab.

ii) (Also, is there a way we can execute each condition in different tabs in chrome rather than opening new browser every time for testing each condition.)
Use send hot keys Ctrl + T it will open a new tab at end of each loop. Then use Navigate To activity to go to any URL

1 Like

Thanks Naveen -
Navigate to activity worked like a charm in current browser and was able to get different data this time.

However, I have necessity to keep the existing browser open and do not refresh the current browser with new data. Rather than, i would need to open new tab and enter URL again. I tried CTRL+t followed by Navigate to option, it opened new tab but it went back to first tab refreshed browser with URL than second tab. I also tried click activity after CTRL+T, but it did not work. Also, if we do this approach, will browser will still retain the old values again and into extractdatatable.

@TharUI,
CTRL+t would just create a new tab but the control will be the previous page. to change control to new tab send hotkey CTRL+Tab this will send control to new tab and then use navigate to url.

regards,
naveen

Naveen - Tried that option too.

Here is the workflow.

  • Open the existing browser
  • Send Hot Key CTRL+t(Opens new tab)
  • Send Hot Key CTRL + Tab (Tried this placing before Navigate to and also after Navigate To)
  • Navigate To activity (with URL)
    Navigate to activity still goes to first browser.

@TharUI,
If your placing CTRL + Tab after navigate to url activity itll send control to previous tab
just keep the CTRL + Tab before the navigate to

Yes Praveen, I have tried that too. I even passed a variable from original browser into Navigate To. It opens new tab but Navigate to doesn’t enter URL on second tab. Still goes to first tab

Tried attach browser as another option and passed variable and included Navigate To inside that. That did not work either

@TharUI,
can you upload your workflow

Main.xaml (7.0 KB)

Please find the attached. Thanks

@TharUI,
Please find the updated workflow attached.Main.xaml (8.1 KB)
I have modified your workflow a bit based on your requirements.
Let me know if you face any issue

Regards
naveen

Thanks Naveen.

However, i have received below error.

Attach Browser ‘iexplore.exe New tab’

Message: cannot find the UI element corresponding to this selector:

Exception Type: UiPath.Core.SelectorNotFoundException

@TharUI,
check attach browser selector and in navigate url don’t give any browser instance

I did not gave anything. I just downloaded and executed the file you gave. Please let me know if i am missing anything.

did u run the whole main file?

Yes I did

ok, open new tab in internet explorer and indicate the selector of attach browser to it

yes, i tried that option.

Opened new tab and Selector is listed as below after clicking indicate on screen
wnd app=‘iexplore.exe’ cls=‘IEFrame’ title=‘New tab - Internet Explorer’

since it is selecting entire window, i also tried editing the selector as below

html title=‘New Tab’

which is same as your selector listed in your original file

Dont edit…let it be for full screen

Tried that as well but got below error

“Value does not fall within the expected range”
Exception Type: System.ArguementException

i have read on similar forums that we should not be selecting entire window.