I\'m using the Python bindings to run Selenium WebDriver:
from selenium import webdriver
wd = webdriver.Firefox()
I know I can grab a webel
Sure we can get all HTML source code with this script below in Selenium Python:
elem = driver.find_element_by_xpath("//*")
source_code = elem.get_attribute("outerHTML")
If you you want to save it to file:
with open('c:/html_source_code.html', 'w') as f:
f.write(source_code.encode('utf-8'))
I suggest saving to a file because source code is very very long.