I'm creating script which will tell us is website is down or up. But I got error HTTPSConnectionPool(host='gooogle.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError("hostname 'gooogle.com' doesn't match 'www.google.com'")))
here is my code:
import requests
website_url = input("Enter a website url: ")
r = requests.get(f'https://{website_url}', timeout=5)
if r.status_code != 200:
print(f"uh no, {website_url} is down")
else:
print(f"Good News, {website_url} is up")
I am using the requests module for this. To be honest, I don't know how to check the website is down or up but still, I write this code if you know how please answer me with details.
os in it, not three.