Associating scraped data with a reference value

Hello, I’ve been having trouble with an aspect of data scraping.
The process as a whole is basically:

  1. Reading a list of product references from an excel column
  2. Navigating to a website
  3. Writing the reference in the search field to reach the product page
  4. Extracting an irregular number of image links from the website with data scraping, which are written down in a different excel sheet

The process is running fine, but my issue is that I need a way to associate these links with the product reference (in order to know what product they belong to), for example by writing the reference next to each link.
However, I don’t know a way to make a counter based on the number of scraped elements (or any other alternative). Is there a way to achieve this?

Do I understand you correctly that your problem is writing both the reference and the links next to each other in an excel file?

Yes, exactly. Since the number of scraped items is different for every new webpage, I don’t know how to write down the correct reference next to each one.

Hi @AdPacem ,

The reference is the row which you are passing to search and scrap right. Hope you are saving the scrape data into your custom table example dtTable. when you build datatable at that time only create a new column “ReferenceData” . After the scrape open a “for each row in DataTable” and assign the reference value to this this column.

Eg:

referencedata = row(“SearchValue”).tostring

In for each loop
assign activity
row(“ReferenceData”) = referencedata .

All these action should be inside your main iterator loop.

1 Like

Hello @manjula_rajendran ,

Thank you for your help, I tried implementing your advice, but I don’t think I am doing it properly, could you please take a look at the files I am using directly?

Product_data.xlsx (11.6 KB)
Extract_template.xaml (20.6 KB)

Thank you!

Hi @AdPacem ,

I’ve looked into your workflow. Is it really works for you? you really messed up everything. Anyways here is the workflow for you.

I didn’t scrape the imageLik as it is asking for login to see the contents. So I just scarped the text from the image which is resulted after search.

To make it work according to your requirement you just need to add the click activity and scrape the imageLink and rest keep as it is.

ExtractTemplate.xaml (17.8 KB)

Thanks,
Manjula

1 Like

Hi @manjula_rajendran ,

Thanks a lot! I’ve had very little experience with UiPath so far, but the workflow was working as far as extracting the image links and writing them down.
I will try your solution and let you know if I encounter any other issues.

Thank you again for your time and patience!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.