10 lines
209 B
Python
10 lines
209 B
Python
|
import urllib.request, urllib.error
|
||
|
|
||
|
def getStatus(url):
|
||
|
try:
|
||
|
return urllib.request.urlopen(url).getcode()
|
||
|
except urllib.error.HTTPError as e:
|
||
|
return e.code
|
||
|
except urllib.error.URLError:
|
||
|
return False
|