Geocrack

Url abfrage fehler

Jul 16th, 2022 (edited)
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. from urllib import response
  2. from requests import get
  3.  
  4. url_list = ["https://www.google.com/", "https://www.facebook.com/", "https://www.youtube.com/"]
  5.  
  6. for url in url_list:
  7.     response = get(url)
  8.     status = response.status_code
  9.  
  10.     if status >= 400:
  11.         print(url, '---- is 4xx err')
  12.     elif status >= 500:
  13.         print(url, '---- is 5xx err')
  14.     else:
  15.         print(url, '---- is ok')
  16.  
  17.  
Advertisement
Add Comment
Please, Sign In to add comment