Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from urllib.request import urlopen, URLError
- def is_online(url):
- try:
- response = urlopen(url, timeout=1)
- except URLError:
- return False
- return response.code == 200
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement