Created
April 17, 2018 16:51
-
-
Save allisonmorgan/218add2e8355be8bedd61b1c2b850628 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from requests.packages.urllib3.exceptions import InsecureRequestWarning | |
from selenium import webdriver | |
def get_url(url): | |
print("Requesting fresh HTML") | |
driver = webdriver.Safari() | |
res = driver.get(url) | |
r = driver.page_source | |
driver.close() | |
return r | |
if __name__ == "__main__": | |
r = get_url('https://www.google.com') | |
assert len(r) > 0 | |
print("Successfully retrieved HTML") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment