5.3 Get HTML Source of WebElement
public void GetHtmlSourceOfWebElement()
{
driver.get("https://saikiranpro.blogspot.in");
WebElement element = driver.findElement(By.xpath("//h3[text()='About Me']"));
string sourceHtml = element.getAttribute("innerHTML");
System.out.println(sourceHtml);
}Last updated