Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from selenium.webdriver.support import expected_conditions as EC
- from selenium.webdriver.support.ui import WebDriverWait
- from selenium import webdriver as wd
- from selenium.webdriver.common.by import By
- import time
- import datetime
- e = datetime.datetime.now()
- day = (e.strftime("%a"))
- executable_path = "F:\Python\chromedriver.exe"
- driver = wd.Chrome(executable_path) # for chrome. wd.Firefox() would be for firefox
- driver.get("https://teams.microsoft.com")
- EMAILFIELD = (By.ID, "i0116")
- PASSWORDFIELD = (By.ID, "i0118")
- NEXTBUTTON = (By.ID, "idSIButton9")
- # wait for email field and enter email
- WebDriverWait(driver, 10).until(EC.element_to_be_clickable(EMAILFIELD)).send_keys("[email protected]")
- # Click Next
- WebDriverWait(driver, 10).until(EC.element_to_be_clickable(NEXTBUTTON)).click()
- # wait for password field and enter password
- WebDriverWait(driver, 10).until(EC.element_to_be_clickable(PASSWORDFIELD)).send_keys("thisismypassword")
- # Click Login - same id?
- WebDriverWait(driver, 10).until(EC.element_to_be_clickable(NEXTBUTTON)).click()
- # Yes button always remember
- driver.find_element_by_xpath('//input[@class="button ext-button primary ext-primary"]').click()
- time.sleep(20)
- physics = "https://teams.microsoft.com/_#/school/conversations/General?threadId=19:[email protected]&ctx=channel"
- math = "https://teams.microsoft.com/_#/school/conversations/General?threadId=19:[email protected]&ctx=channel"
- electrical = "https://teams.microsoft.com/_#/school/conversations/General?threadId=19:[email protected]&ctx=channel"
- mechanical = "https://teams.microsoft.com/_#/school/conversations/General?threadId=19:[email protected]&ctx=channel"
- cs = "https://teams.microsoft.com/_#/school/conversations/General?threadId=19:[email protected]&ctx=channel"
- driver.get(physics)
- driver.find_element_by_xpath('//input[@class=""]').click()
- # time.sleep(2750)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement