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