I need to scan a given set of URLs and get the HTTP status codes like "200 OK" in Python. I’m currently using urllib to do this. Is there a faster way to do this?
Python code
def get_status(url):
try:
return urllib.urlopen(url).getcode()
except StandardError :
return None
Yes there is.