I\'m using the Python bindings to run Selenium WebDriver:
from selenium import webdriver
wd = webdriver.Firefox()
I know I can grab a webel
InnerHTML will return element inside the selected element and outerHTML will return inside HTML along with the element you have selected
Example :- Now suppose your Element is as below
A B
innerHTML element Output
A B
outerHTML element Output
A B
Live Example :-
http://www.java2s.com/Tutorials/JavascriptDemo/f/find_out_the_difference_between_innerhtml_and_outerhtml_in_javascript_example.htm
Below you will find the syntax which require as per different binding. Change the innerHTML
to outerHTML
as per required.
Python:
element.get_attribute('innerHTML')
Java:
elem.getAttribute("innerHTML");
If you want whole page HTML use below code :-
driver.getPageSource();