Get HTML Source of WebElement in Selenium WebDriver using C#

Get HTML Source of WebElement in Selenium WebDriver using C#

To return the inner HTML source you need to use the element.GetAttribute("innerHTML") code as shown below.

string output = element.GetAttribute("innerHTML");

Leave a reply

Your email address will not be published. Required fields are marked*

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
6 + 7 =

Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.