Skip to content

Instantly share code, notes, and snippets.

@marshyski
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marshyski/2b08423d3e1ad110e0e1 to your computer and use it in GitHub Desktop.
Save marshyski/2b08423d3e1ad110e0e1 to your computer and use it in GitHub Desktop.
Grab status from multiple URLs
#!/usr/bin/python
import requests
urls = [
'http://192.168.1.5/',
'http://192.168.1.15/',
'http://192.168.1.5:8080',
]
for URL in urls:
r = requests.get(URL)
print r.url, r.headers['Server'], r.status_code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment