selenium print element html code example
Example 1: selenium print html
element.get_attribute('innerHTML')
Example 2: selenium python get innerhtml
element = driver.find_element_by_xpath('//*')
element = element.get_attribute('innerHTML')
Example 3: python selenium get html content
element.get_attribute('innerHTML')
Example 4: selenium print html
elem = driver.find_element_by_xpath("//*")
source_code = elem.get_attribute("outerHTML")