Skip to content

Instantly share code, notes, and snippets.

@yasyf
Created December 4, 2013 08:15
Show Gist options
  • Save yasyf/7783958 to your computer and use it in GitHub Desktop.
Save yasyf/7783958 to your computer and use it in GitHub Desktop.
import requests
sites = get_sites_from_db()
for s in sites:
try:
r = requests.head(s)
if r.status_code in [404,500]:
remove_site_from_db(s)
except Exception:
continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment