Looking to extract specific text from a DIV? Take a look at this sample DIV source:
<html>
<div class="roamingHostIdContainer ng-binding">
Host ID: 3K9X-Q8LD-6AX6-3UGP-UL5B-YE3Z-UWCD-DGDU-AB8Y-FJD2-7W97-A63J-RVZA
</div>
</html>
It seems like the div has excessive spaces. But, my main goal is to retrieve and copy the ID value.
I first approached my challenge through these inquiries: How to manipulate user selected text using webdriver?, then shifting to: How to move cursor in Selenium Webdriver
My initial thought was utilizing a javascript executor, but I am uncertain about its application. My strategy involved creating elements with just the "Host ID:" and "RVZA" text respectively. However, creating an element based solely on that text could pose issues as both elements would be identical.
If anyone can offer guidance or steer me in the right direction, I would greatly appreciate it.