How to get a Data Table from the web html source?

I want to get a data table from a web page. I tried the data scraping activity, but Uipath did not recognize the data table area as a data table variable type. It recognized the data table just as a string. And some of the elements in the data table could not be recognized.( For example: check box)

I checked the html source of the web page and found there was a “table class” in the html source. If I know the value of the “table class”, how can I get all the elements in the data table ? It’s better to get all the elements as Data Table variable type.

Hi,

The following topic might help you.

Regards,

Hi @anka1

Have a look on the documentation

HTML to Datatable - RPA Component | UiPath Marketplace

Regards
Gokul

HI @anka1

Enable these in the extension

I am not sure it will work but just give it a try this

  • Use the Screen Scrapping method and scrap the whole table by selecting the region
  • After getting it from the page store it in a variable.
  • Use Generate datatable and pass the string variable which you got from the screen scraping and check with each and every column separators to see which suits your datatable and store that in a variable.
  • Write that data in excel to see whether it is written the data correctly

Regards
Sudharsan

Thank you very much.
Now I can get the data table. But I have one more question.
There are check boxes in the data table and I want to get the “checked” attribute(True or False) using data scraping. I wrote the “ExtractMetadata” in Uipath as below:

But it did not work. The value was “Null” in the data table. I think the reason is that “checked” attribute is boolean data type, but only string data type is supported in data table.
So, How to write the “ExtractMetaData”(XML editor window) in uipath to convert boolean to string and put it into the data table ?

It seems that the contents in the XML editor can not be displayed. So I converted “<>” to “<>”

<column attr=‘checked’ name=‘Check box’ exact='1’>
<webctrl tag=‘tr’ />
<webctrl tag=‘td’ idx=‘7’ />
<webctrl tag=‘input’ idx=‘1’ />

@anka1
there are different strategies e.g. reacting on the result of the checked=‘checked’ attribute and the resulting null or empty value indicating if it was checked or not.

In a cleansing job we just translate this information afterwards to True or False

Checkboxes can be also different or enriched with classes… For a better strategy we would check with you for alternates. May we ask you to share with us the URL or screenshots of the HTML structures for a checked and an unchecked checkboy. Thanks

Hi,

As @ppr mentioned, if there is difference regarding class etc between both, we can use it for datascraping.

An alternative way is to combine it with result of FindChildren activity, as the following, for example.

Regards,

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