Get a Selector/HTML Code from Robot

Hi everyone,

I’m working on a project in wich I have to recognize how many elements and their type inside a webpage. I mean, inside a section in the webpage called “Datos” I have to recognize how many fields there are, and their type (checkbox list, select list o just a text field).

The way I thought to achieve the solution is reading the HTML code, but I would need to get the selector of the section “Datos” and then, through regex, get how many fields there are.

Do you know how can I get the string/selector from the robot?

Thank you!

Kindly check if this would help

Thanks for your answer, but it does not work as I want. That code get the global html of the page, but not as it is shown. What I want is to get the HTML of what there is in the moment I open the page. For example, in this webpage, what I would like to get is the HTML which contains our comments, and users name, every element we can see in an explicit way.

Hi @ajg,

Have you tried with Get Attribute activity? There you can get, for example, OuterHtml or InnerHtml

Another alternative could be to use Find Element activity, save it into a variable (myElement) and later assign to a String variable myElement.Selector