How to copy the Div as HTML element?

Hi @ClaytonM ,

I want to copy this div with id = “Messagebodydisplay” as HTML element from this link but don’t know how to copy. Is there any way?

Site : How to connect to the console of an Aruba AP over Bluetooth using Android and Aruba Utilities

Thanks,
Ula

I don’t have Studio here, so I can’t check it. But, easiest way would be to open UiExplorer then select the same element that you chose in IE Inspect Element, and that should generate the selector.

1 Like

Thank you @ClaytonM. I want to copy the entire div and save it in rich text to get the full content of the kb article. Not trying to capture the selector.

I will check it out.

Thanks,
Ula

I’m still not sure why you want to use the html div of that element to get the content. You can use the Get Text activity or Data Scraping (Extract Structured Data). - That’s how you would normally get the content inside a div in UiPath. EDIT: also, Find Children will let you filter by the div tag, so look into that too.

Additionally, if you use the Find Element activity and output that to an element variable, you can get more info on the element, like element.Selector (if that’s an option) … I don’t remember all the options you have with an element variable, but it’s just another thing to think about.

1 Like

Hi @Boopathi Ula,

I may be misunderstanding what you asking but if you are trying to to obtain your div element as a string representing its HTML format you can use its innerhtml/outerhtml attributes by using either the Get Attribute or using uiElem.Get("innerHtml").toString

Cheers

2 Likes

Hi @ClaytonM and @Florent_Salendres Thank you for your suggestion. Actually I am not trying to retrieve any particular value from the div and want to capture all the div contents and paste it in a rich text box like div scrapping. I was able to achieve it by copying div and its html elements.

Thanks,
Ula

2 Likes