Skip to content

Instantly share code, notes, and snippets.

@allisonmorgan
Created April 17, 2018 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save allisonmorgan/218add2e8355be8bedd61b1c2b850628 to your computer and use it in GitHub Desktop.
Save allisonmorgan/218add2e8355be8bedd61b1c2b850628 to your computer and use it in GitHub Desktop.
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