Can we compare class name from Xpath web element?

WebSiteScrap_3.zip (1.1 KB)

Please check the code above and update the excel file as per the symbols as:
image
for first one it should be type 1 (because first is active)
for second one it should by type 4 (because 4th is active)

@dhaval_ka you need to read the class attribute of the web element and use if-else condition to define if the class contains ‘is-disabled’ text. If it does, the bot does nothing as the icon is not active. If it doesn’t contain it, the icon is active and you can write the type to excel file (you can extract it using text actions).

WebSiteScrap_3.rar (1.1 KB)

1 Like

Thank you Alesia. I have checked but i have to add the name of supplier with that too.
Like Banderoliermaschinen - manufacturer.

You can read the name from the website using xpath and save ti a List variable the same way and then combine the name with the type using Constant value and will paste the result to Excel.
Also, create a special variable of Number type that you will use as an index for the list and that will increment by 1 in each loop so you also insert a new company name.

Ok great thanks

But it will fail in this condition as a supplier may perform 2 different roles. (e.g. provider and wholesaler)

You can read the classes for each type of icon to 4 separate lists, and then use several if conditions to define if the icon is disabled or not. If it is disabled - the variable for the corresponding type will be blank, if it is not - the variable will contain the type. Then you can combine all type together using Constant value action and write to Excel.

Here is an example
WebSiteScrap_3.rar (2.4 KB)