Skip to content

Instantly share code, notes, and snippets.

@infiniteregrets
Created September 26, 2021 01:20
Show Gist options
  • Save infiniteregrets/438b00a47d9cfe0c6df1dd28bdb1868d to your computer and use it in GitHub Desktop.
Save infiniteregrets/438b00a47d9cfe0c6df1dd28bdb1868d to your computer and use it in GitHub Desktop.
from selenium import webdriver
import time
import datetime
driver = webdriver.Chrome()
driver.get("https://macreconline.ca/")
login_button = driver.find_element_by_id("loginLink")
login_button.click()
time.sleep(3)
redirect_login = driver.find_element_by_xpath('//*[@id="divLoginOptions"]/div[2]/div[2]/div/button')
redirect_login.click()
time.sleep(3)
username = driver.find_element_by_id("username")
username.send_keys("") #Your username goes in this string
password = driver.find_element_by_id("password")
password.send_keys("") #Your password goes in this string
submit_button = driver.find_element_by_id("submit")
submit_button.click()
time.sleep(3)
accept_terms = driver.find_element_by_id("accept")
accept_terms.click()
submit_again = driver.find_element_by_xpath('//*[@id="site-content"]/section/div/div/div/div/div/div/div[2]/form/input[2]')
submit_again.click()
driver.get("https://macreconline.ca/Program/GetProgramDetails?courseId=c848599d-ea88-422f-918b-b0f9ca672ed8&semesterId=c89b35a7-e759-4959-9f77-69f747a50fa2")
tmrw = int(datetime.date.today().strftime('%d')) + 1
slots = driver.find_elements_by_class_name("program-schedule-card-header")
print(slots[0].text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment