Skip to content

Instantly share code, notes, and snippets.

@ikegami-yukino
Created April 22, 2015 11:24
Show Gist options
  • Save ikegami-yukino/7a297ea50a0f198645c1 to your computer and use it in GitHub Desktop.
Save ikegami-yukino/7a297ea50a0f198645c1 to your computer and use it in GitHub Desktop.
session = requests.Session()
session.mount('http://', requests.adapters.HTTPAdapter(max_retries=3))
session.mount('https://', requests.adapters.HTTPAdapter(max_retries=3))
response = session.get(lp, headers={'User-agent': UA}, timeout=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment