-
Notifications
You must be signed in to change notification settings - Fork 0
/
classbot.py
33 lines (27 loc) · 1.33 KB
/
classbot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from selenium import webdriver
#author : Sayyed Viquar Ahmed
# For using sleep function because selenium
# works only when the all the elements of the
# page is loaded.
import time
import schedule as sc
from selenium.webdriver.common.keys import Keys
# Creating an instance webdriver
def hetcollegeconnected():
browser = webdriver.Chrome()
for i in range(0,10):
print("Connecting with the COllege Server...")
## Replace it with your collge website // replace it with your college 😅😅
# Let's the user see and also load the element
time.sleep(2)
print("Successfully COnnected with College Server")
username=str(input("Enter your username"))
password=str(input("Enter your password"))
browser .find_element_by_xpath("/html/body/div/div[1]/div/div/div[2]/div/div[2]/p[1]/form/div/input").send_keys(username)
browser .find_element_by_xpath("/html/body/div/div[1]/div/div/div[2]/div/div[2]/p[1]/form/div/di v[2]/input").send_keys(password)
browser .find_element_by_xpath("/html/body/div/div[1]/div/div/div[2]/div/div[2]/p[1]/form/button").click()
ans=str(input("Do you want to close th browser ?"))
if ans =="yes" or ans=="YES":
browser.close()
if __name__ == '__main__':
sc.every().day.at("21:00").do(hetcollegeconnected())