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 the Google account and join a meeting through Google meet with 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:
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course