我正在创建一个应用程序,它基本上只是在他们的特定时间加入我的缩放会议,但问题是我使用的是 schedule 1.0 库,它不能正常工作,就像函数在给定时间没有运行一样。我尝试在网上寻找任何我找不到有用的帖子,因此我在这里问你们这个问题。
我的代码
from selenium import webdriver
import time
import schedule
import datetime
from selenium.webdriver.common.keys import Keys
from apscheduler.schedulers.background import BackgroundScheduler
x = input("Is it A day or B day? ")
Advisory = "google.com"
ELA = "google.com"
Economics = "google.com"
French = "google.com"
Math = "google.com"
Social_Studies = "google.com"
Science = "google.com"
browser = webdriver.Safari()
if x.lower() == "a":
print("Ok great!")
print("The program will start shortly")
def AdvisoryLogin():
browser.get(Advisory)
obj = browser.switch_to.alert
msg=obj.text
print ("Alert shows following message: "+ msg )
obj.accept()
browser.close()
schedule.every().day.at("03:19").do(AdvisoryLogin)
while True:
schedule.run_pending()
time.sleep(1)