How can I get the HTML source in a variable using the Selenium module with Python?
I wanted to do something like this:
from selenium import webdriver
browser = webdriver.Firefox()
browser.get("http://example.com")
if "whatever" in html_source:
# Do something
else:
# Do something else
How can I do this? I don't know how to access the HTML source.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…