|
| 1 | +#Importing Required modules and Libraries |
| 2 | + |
| 3 | +from selenium import webdriver |
| 4 | +import schedule,time |
| 5 | +import keyboard |
| 6 | +from selenium.webdriver.common.keys import Keys |
| 7 | +from selenium.webdriver.common.action_chains import ActionChains |
| 8 | +from selenium.webdriver.chrome.options import Options |
| 9 | + |
| 10 | +#joining Credentials |
| 11 | + |
| 12 | +username = str(input('Your Username:' )) # asking for mail id |
| 13 | +password = str(input('Your Password:' )) #asking for password |
| 14 | +Driver_path = str(input('Enter your path where the chrome drive is installed:' )) #Saving the path of chrome driver |
| 15 | + |
| 16 | +#Providing camera and microphone access to the meeting |
| 17 | + |
| 18 | +opt=Options() |
| 19 | +opt.add_argument("--disable-infobars") |
| 20 | +opt.add_argument("start-maximized") |
| 21 | +opt.add_argument("--disable-extensions") |
| 22 | + |
| 23 | +# Passing the argument "1" to allow and "2" to block |
| 24 | + |
| 25 | +opt.add_experimental_option("prefs", { \ |
| 26 | + "profile.default_content_setting_values.media_stream_mic": 1, |
| 27 | + "profile.default_content_setting_values.media_stream_camera": 1, |
| 28 | + "profile.default_content_setting_values.notifications": 1 |
| 29 | + }) |
| 30 | +browser =webdriver.Chrome(chrome_options=opt,executable_path=Driver_path) #Entering the path of chrome driver |
| 31 | +browser.maximize_window() |
| 32 | +action=ActionChains(browser) |
| 33 | + |
| 34 | +#Function for entering into meeting as per the google meet interface |
| 35 | +def get_into(): |
| 36 | + keyboard.press_and_release('Tab') |
| 37 | + time.sleep(1) |
| 38 | + keyboard.press_and_release('Tab') |
| 39 | + time.sleep(1) |
| 40 | + keyboard.press_and_release('Tab') |
| 41 | + time.sleep(1) |
| 42 | + keyboard.press_and_release('Tab') |
| 43 | + time.sleep(1) |
| 44 | + keyboard.press_and_release('Tab') |
| 45 | + time.sleep(1) |
| 46 | + keyboard.press_and_release('Enter') |
| 47 | + |
| 48 | + |
| 49 | +#Finding the scheduled meeting on the google calender. |
| 50 | +def join_classes(): |
| 51 | + |
| 52 | + browser.get("https://calendar.google.com/") |
| 53 | + browser.find_element_by_name("identifier").send_keys(username) |
| 54 | + browser.find_element_by_class_name("VfPpkd-RLmnJb").click() |
| 55 | + |
| 56 | + browser.implicitly_wait(20) |
| 57 | + browser.find_element_by_name("password").send_keys(password) |
| 58 | + time.sleep(1) |
| 59 | + browser.implicitly_wait(40) |
| 60 | + browser.find_element_by_class_name("VfPpkd-RLmnJb").click() |
| 61 | + |
| 62 | + browser.implicitly_wait(15) |
| 63 | + cursor_location=browser.find_element_by_class_name('h11RHc').location |
| 64 | + x=cursor_location['x'] |
| 65 | + y=cursor_location['y'] |
| 66 | + action.move_by_offset(x+20,y).click().perform() |
| 67 | + browser.find_element_by_class_name("w1OTme").click() |
| 68 | +#Entering Google meet |
| 69 | + |
| 70 | + time.sleep(30) |
| 71 | + |
| 72 | + keyboard.press_and_release('ctrl+e') |
| 73 | + keyboard.press_and_release('ctrl+d') |
| 74 | + print("Camera And microphone turned off") |
| 75 | + browser.implicitly_wait(10) |
| 76 | + print("About to join the class") |
| 77 | + get_into() |
| 78 | + keyboard.press_and_release('Enter') |
| 79 | + print("Slid into the meeting successfully") |
| 80 | + time.sleep(5) |
| 81 | + keyboard.press_and_release('Win+alt+r') |
| 82 | + print("meeting Recording Started") |
| 83 | + |
| 84 | +join_classes() |
| 85 | + |
| 86 | +#schedule according to your time table and quit the browser according to the time of completion of your class |
| 87 | +# schedule.every().day.at("09:00").do(join_classes) |
| 88 | + |
| 89 | +#while True: |
| 90 | + #schedule.run_pending() |
| 91 | + #time.sleep(1) |
0 commit comments