Skip to content

Instantly share code, notes, and snippets.

@JeyKJey
Last active September 26, 2018 06:42
Show Gist options
  • Save JeyKJey/a33467fae4c9f7fac64f067501b484ac to your computer and use it in GitHub Desktop.
Save JeyKJey/a33467fae4c9f7fac64f067501b484ac to your computer and use it in GitHub Desktop.
try:
page_response = requests.get(page_link, timeout=5)
if page_response.status_code == 200:
# extract
else:
print(page_response.status_code)
# notify, try again
except requests.Timeout as e:
print("It is time to timeout")
print(str(e))
except # other exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment