Selenium Get Html of Element (Python)

June 13, 2019
el = driver.find_element_by_css_selector('h3')
if el:
    print(item_el.get_attribute('outerHTML'))   # include h3
    # or
    print(item_el.get_attribute('innerHTML'))   # exclude h3
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.