Skip to content

Instantly share code, notes, and snippets.

@ChaitanyaBaweja
Last active March 19, 2020 19:18
Show Gist options
  • Save ChaitanyaBaweja/f908b9fe7964a14d28834912e948495c to your computer and use it in GitHub Desktop.
Save ChaitanyaBaweja/f908b9fe7964a14d28834912e948495c to your computer and use it in GitHub Desktop.
import schedule
import time
# take input initially and setup driver once
Country = input('Enter Country Name: ')
driver = webdriver.Chrome('path/to/chromedriver')
def covid_update():
data_dict = extract_data(Country) # extract fresh data
send_mail(data_dict) # sending email based on the dict
return
# scheduled for every dat at 10:00 am
schedule.every().day.at("10:00").do(covid_update)
while True:
schedule.run_pending()
time.sleep(1) # wait one minute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment