Java selenium grabbing entire html contents of the element Java selenium grabbing entire html contents of the element selenium selenium

Java selenium grabbing entire html contents of the element


You can read outerHTML attribute to get the entire element.

element.getAttribute("outerHTML");

Or in your case:

System.out.println(element.get(3).getAttribute("outerHTML")); 

Hope it helps!