Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from urllib import response
- from requests import get
- url_list = ["https://www.google.com/", "https://www.facebook.com/", "https://www.youtube.com/"]
- for url in url_list:
- response = get(url)
- status = response.status_code
- if status >= 400:
- print(url, '---- is 4xx err')
- elif status >= 500:
- print(url, '---- is 5xx err')
- else:
- print(url, '---- is ok')
Advertisement
Add Comment
Please, Sign In to add comment