Last active
March 19, 2020 19:18
-
-
Save ChaitanyaBaweja/f908b9fe7964a14d28834912e948495c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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