Html table to datatable

I have a workflow which downloads a file from a website and the content of the file is an html table.

I need to be able to directly transform the content of this table to a datatable, without having to open a browser instance and perform data scraping, since the records are too many and it takes a long time to load in the browser if I want to open the file.

I followed some tutorials and they did not serve the purpose I wanted, since, as I said, they involve opening the browser and the html table includes at least 10,000 records and takes a long time to load, so it would be ideal to be able to load the file directly as a string and then be able to perform some operation.

Here I leave you an extract of the file that I must transform to datatable.

Hi @vfaundez ,
I haven’t imagined your file yet
What file format is it?
Can you upload a photo or send a demo file?
I think there will be a way to convert, for example regex
regards,

Try using the Read Text File activity.

Hi @vfaundez

You can read the html file as Text file and then use Read Text Activity
After that you can use activity called Generate DataTable From Text

Hope this helps

Hi @vfaundez

1.Simply you can use Read Text File activity
2.Create HTML Content activity

image

Edit the post and add a screenshot with part of the file that I must transform to datatable.

But what I need is to transform an html document into a datatable.

Hi @vfaundez

You can try out this package

HTML to DataTable - RPA Component | UiPath Marketplace | Overview

Install it in Manage Packages

UiPathTeam.ExtractDataTablesFromHTML.Activities

Cheers

1 Like

I tried to use that component, but it didn’t work for me.
I only store the records, but not the headers and the headers are always changing.

Hi @vfaundez

I’m not sure if I understand right. The only problem with that component is the header ? If so, you already tried set as false the field UseFirstRowAsHeader ?

Also you can do string manipulation to treat exception before use that activity

Is it possible to provide a html file as example and the expected result ?

Cheers

In the end I chose to use “Excel application scope” so that Excel performs the conversion and then export the result to csv and still be able to store the result in a datatable for possible other uses.

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