I need to check availability of a specific website. I am trying to write a Python script that will ping a website every 15 minutes. If the website is down, I would like it to output "website is not available" and send an email notifying the user that the website is down.
I am pretty new to python and I do not know where to start.
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("--headless")
driver = webdriver.Chrome(options=chrome_options, executable_path="C:/Users/TX394UT/Desktop/Web_Bot_Project/chromedriver.exe")
driver.get("https://www.google.com/")
print(driver.title)
driver.close()
driver.quit()
print("Completed Sucessfully")
If This site can’t be reached, I would like for it to send me an email notification. I would like for the script to run every 15 minutes.