Adding the ID-value from one Datatable to another

Okay I give up! – so I need your help.

I have a CSV-file containing two columns “ID” and “URL”. It gets loaded into a Datatable, ‘output’ and then I scrape 7-9 lines from each URL. The output from the webscrape gets saved, via a “for each row”, in the datatable ‘ScrapOutput’ with the columns “Name” and “Value”. Then I add a third column to ScrapOutput called “ID”.

Here is what I need some help with. I would like to add the value of “ID” from the URL that is used to scrape to the 7-9 lines added to ‘ScrapOutPut’. So that the 7 lines from a given URL that is added to ‘ScrapOutput’ all have the same ID as the URL has in the original CSV-File.

How do I do that?

Hi. So to summarize your problem:
—you have a table with “ID” and “URL”
—you go to each url and extract more data to ScrapOutput with “Name” and “Value”
—final step needed is to store the “ID” from first table to the extracted table in an “ID” column

So I’m assuming you start with a “For each row” to go to each url.
Here is some psuedocode of what I am thinking you need:

For each row1 in output
    Open Browser or Navigate To // row1("URL")
        Extract Structured Data // web scrape
        Add Data Column // add "ID" column
        For each row2 in ScrapOutput
            Assign row2("ID") = row1("ID").ToString.Trim

So you loop through ‘output’ table and navigate to each URL. Webscrape data, Add ID column, Then loop through each row of the scraped table. And, finally, Assign the “ID” from row1 to the scraped row2.

Regards.

2 Likes

See a similar post

image

3 Likes

Thanks :slight_smile: - I made it work … Had to add an additional datatable to ensure that I didn’t end up with the same ID number for every single row.

1 Like