Skip to content

Instantly share code, notes, and snippets.

@pengelana
Created April 26, 2020 05:08
Show Gist options
  • Save pengelana/7487143057a61dfd1e711a8ff8c38a9c to your computer and use it in GitHub Desktop.
Save pengelana/7487143057a61dfd1e711a8ff8c38a9c to your computer and use it in GitHub Desktop.
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