Scrape specific classes based on text

Hi everyone,

I am currently trying to get some data from a website, which is normally no big issue. However this time I want to scrape tables that consist part of text and part of symbols. For example:

As you might see, I have some “X” symbols and some “tickmark” symbols. Both have HTML classes “<span class="glyphicon glyphicon-ok text-success"></span>” or “<span class="glyphicon glyphicon-remove text-light"></span>”. Is there any way to extract the row title as plain text and insert a specific text like “Yes” or “no” depending on whether I have a " glyphicon-ok text-success" or “glyphicon-remove text-light”.

In the end it should look (in an excel spreadsheet) like:
SDGs: Yes
CDP: Yes
IFC: No
OECD Guidelines: Yes
UNGC: Yes
ISO26000: No
.
.
.

Anyone an idea how do achieve this in UIPath?

Hi @Florian92

Use Get attributes and keep it as Class or check with the HTML tag

cool,
Regards,
Gulshiyaa

This only works for the current website. When I try to iterate through multiple websites it does not give me back the correct value (I am working with an IF statement, seems that the CSS selector is different for multiple webpages…). Is it possible to determine the left labels as anchor and to only extract the right value? The problem is that the tables range is changing for each website. Sometimes I have 7 rows, soetimes 5, sometimes 6…

@Florian92
without knowing on structure details the advices are more general and we have to break down step by step to tje details

The problem is that the tables range is changing for each website. Sometimes I have 7 rows, soetimes 5, sometimes 6…

the common strategy in such scenarios is to use a dynamic selector (for get attribute) and is doing the iteration over the the rows for collecting the values

However how is your data scraping done with the activity or manually organised (get, Text, Find children, get Attribute …)? Sometimes additional columns / infos can be configured in the scraping process as well. Afterwards these infos get be postprocessed and so a span class “OK” can be translated/ text replaced by YES

Let us know your open questions, if possible also give us so many infos to the structures as well (Screenshots from uiexplorer on vusiual tree, F12 Browser tools Screenshots, URL …)

@ppr: Ok, to give you some more insights. If i have the following two websites:

https://database.globalreporting.org/reports/63117/ and https://database.globalreporting.org/reports/49283/.

You will see that the amount of columns is differing between both websites. I tried to use “Data Scraping” which is working for the column labels, however I only get empty values for the “tickmark” and “cross” symbols. However the pecific characteristics are the most relevant for me (“tickmark” = “Yes” and “Cross” = “No”). I am not quite shure whether I can achive this with get attribute as I would need the label of each column as “anchor” to find the respective text. In the end I would like to get an output that looks like this (I took the Daimler website as an example):

Hope this is enough information. Would be glad if someone has some good hints on how to achieve this.

@Florian92
I answered you by messages. We can go soon into the second iteration. It looks good so far :slight_smile:

Alright, thanks to @ppr. The solution looks like this:
Florian92.xaml (33.7 KB)

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