Extract Search results from web

Hello Everyone,

I am trying to create a workspace where I extract search results, from web, to excel. While I have successfully used Data Scrapping tool to extract info, I want to make a little adjustment to the workflow.

I want to have all the data from the specified search results in 1 cell, instead of the bot writing it in different rows.

For example: the bot searches ‘iPhone’ → the extracted data ('iPhone 13, iPhone 12,…) in one cell beside ‘iPhone’ in excel.

Note: Some search results have 1 output and some have more than 1 result.

Thank you in advance for the help :slight_smile:

Hi @hashibulh ,

Could you let us know if this is a Google Search you are performing ?

Or could you provide us the Link of the Web Search where you are trying to extract the data, if it is publicly accessible ?

Create a variable to store the final string.

For Each Row in datatable
Assign FinalStr = FinalStr + CurrentRow(“columnname”).ToString + “,”

Unfortunately the site is not publicly accessible. It is basically a medical site where we can search for the diagnosis name and extract the information of the search. So some of the diagnosis names results in multiple output and some results in one output. i want to have all of the results (regardless of the number of outputs) in one cell beside excel. Otherwise the following cells which have a different diagnosis name will have incorrect results.

Did not work. Do I have to initialize ‘CurrentRow’ to something? It says ‘CurrentRow’ is not initialized.

@hashibulh Try this

  • Convert the output of data scraping which is data table to String using Output Data Table activity. Then use write Cell activity it will write the complete data in a single cell. Use attached workflow

Example.zip (10.9 KB)

Output

Capture

You use whatever is in the properties of the For Each Row. You can name it whatever you want. In modern it defaults to CurrentRow:

image

Thank you for your help however, I wanted the data to be in each row but all of the data, of the particular search result, in 1 cell. So search results for ‘Cholera’ (No matter how many results there are) will be beside its name in excel. Then ‘Typhoid Fever’ results will be beside its name (all of the search results beside its name in one 1 cell).

Apologies if I was not clear earlier :slight_smile:
Appreciate the help!