Automating Google meet using selenium in Python
Selenium is a powerful tool for controlling web browsers through programs and performing browser automation. It is functional for all browsers, works on all major OS and its scripts are written in various languages i.e Python, Java, C#, etc, we will be working with Python.
Selenium can be used to automate the web browser. In this article, we will learn how to sign in a Google account and join a meeting through Google meet with a camera and microphone turned off using selenium.
The selenium module can be installed using the below command:
pip install selenium
Step 1: Import modules
Step 2: Create an instance of Chrome browser with some required prerequisite Chrome Options().
Step 3: Go to Google meet using this command
Step 4: Calling the below function will turn off the camera and the microphone. In this function, turnOffMicCam(), we find the microphone & camera buttons by their xpaths using a function in selenium named find_element_by_xpath().
Step 5: Below function would help us join the meeting at Google meet. In this function, joinNow(), we find the join now button by its css selector using a function in selenium named find_element_by_css_selector() and click it to join the meeting! (we do the same in AskToJoin() function).
Step 6: Below is the function that would log in the Google account using the credentials provided. In this function, Glogin(mail,pw), we find the email text box by its id using a function in selenium named find_element_by_id() and type in the email using send_keys() & click next button again using its id and find password text box using its xpath, type in the password using send_keys & again click login using its id
Below is the complete program based on the above step-wise approach: