0

I am creating an application that basically just joins my zoom meetings at their specific times but the problem is that I am using the schedule 1.0 library and it isn't properly working like the function doesn't run at the given time. I tried looking online for anything an I couldn't find a single helpful post thus I am here to ask you guys this question.

My Code

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)
Vasu Bansal
  • 41
  • 1
  • 6

1 Answers1

0

I would start with ensuring you have the selenium package installed.

pip install -U selenium

Then I would adjust the code at the input level to reformat to .lower()

import selenium
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? ")
#x = x.lower()

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)
  • Ok I understand what you are saying but not to be rude, that doesn't really answer my question at all can you please answer it. – Vasu Bansal Feb 09 '21 at 02:57
  • Make sure your time is correct (military time needs to be used.) + I would suggest using a virtual environment in your directory (venv) to ensure you do not have any issues with dependencies. – gauge-marketing Feb 09 '21 at 14:17