Created
April 26, 2020 05:08
-
-
Save pengelana/7487143057a61dfd1e711a8ff8c38a9c 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
import requests | |
try: | |
from hyper.contrib import HTTP20Adapater as HTTPAdapater | |
except ImportError: | |
from requests.adapters import HTTPAdapter | |
session = requests.Session() | |
session.mount('https://', HTTP20Adapter(max_retries=3)) | |
r = session.get('https://www.instagram.com/') | |
print(r.status_code) | |
print(r.url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment