By using python, how can I check if a website is up? From what I read, I need to check the "HTTP HEAD" and see status code "200 OK", but how to do so ?>
my 2 cents
def getResponseCode(url): conn = urllib.request.urlopen(url) return conn.getcode() if getResponseCode(url) != 200: print('Wrong URL') else: print('Good URL')