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 ?>
In my opinion, caisah's answer misses an important part of your question, namely dealing with the server being offline.
Still, using requests is my favorite option, albeit as such:
requests
import requests try: requests.get(url) except requests.exceptions.ConnectionError: print(f"URL {url} not reachable")