python selenium get html code example
Example 1: selenium print html
element.get_attribute('innerHTML')
Example 2: python selenium get html content
element.get_attribute('innerHTML')
Example 3: how to get html code in selenium python
#_*_coding: utf-8_*_
from selenium import webdriver
import time
# start web
browserbrowser=webdriver.Firefox()
# get source
codebrowser.get("https://en.wikipedia.org")
html = browser.page_source
time.sleep(2)
print(html)
# close web browser
browser.close()