From eb65833b1cbaf3007eb5372774281cd31d879c30 Mon Sep 17 00:00:00 2001 From: Aswin Krishna <116379127+TheProv1@users.noreply.github.com> Date: Sun, 15 Oct 2023 10:50:50 +0400 Subject: [PATCH] Add files via upload This script checks if the url/web address entered is active or not --- Website_Status_checker.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Website_Status_checker.py diff --git a/Website_Status_checker.py b/Website_Status_checker.py new file mode 100644 index 0000000..d206d7c --- /dev/null +++ b/Website_Status_checker.py @@ -0,0 +1,16 @@ +import requests + +def check_status(url): + try: + resp = requests.get(url) + if resp.status_code == 200: + print("Website is up and running") + else: + print("Website is unreachable") + + except requests.ConnectionError: + print("Error, website url or address is not currently available") + +web_link = input("Enter the name of the website: ") + +check_status(web_link) \ No newline at end of file