Automate Messaging On Google Meet

0
2 min read
Google meet image for automation.
google meet logo

Due to COVID-19, online meetings have their own importance. So why not we try python to automate the message sending in the google meet.
For this, you need basic knowledge of selenium, python, and HTML.

In this blog, I am going to share the script of automating messages so if you are a beginner then I will suggest readers to read Automate Whatsapp Using Python to get knowledge of selenium. You can modify the below script according to your need.

# importing required modules
from selenium import webdriver
from selenium.webdriver.common.keys import Keys

# Your Google meet URL
meet_url = 'https://meet.google.com/agz-sraz-efj'

# Initialising drivers.
driver = webdriver.Chrome('C:\chromedriver.exe')

# Due to security reasons google has blocked Sign In from automated or third-party applications.
# To login your google account enable less secure apps in your Google settings.
# After this you can do the login manually or by writing two more lines in the same code. 
# (I am not writing code for log in because when you try on your own you learn many new things.)
driver.get('https://gmail.com')

# going to the meet URL after login.
driver.get(meet_url)

# getting the message button in google meet.
xpath_btn = '/html/body/div[1]/c-wiz/div[1]/div/div[4]/div[3]/div[6]/div[3]/div/div[2]/div[3]/span/span/div/div/span[1]'
btn = driver.find_element_by_xpath(xpath_btn)
btn.click()

# finding the text box to type message in text box.
x_path = '/html/body/div[1]/c-wiz/div[1]/div/div[4]/div[3]/div[3]/div/div[2]/div[2]/div[2]/span[2]/div/div[3]/div[1]/div[1]/div[2]/textarea'
t_box = driver.find_element_by_xpath(x_path)

# sending messages.
message = 'Hello, I am Sankalp from FreshlyBuilt.'
t_box.send_keys(message,Keys.ENTER)

Key points about what we have done in this script are:-

  1. importing the required modules.
  2. google meet URL.
  3. Driver Initialisation. (If you don’t have the drivers then search on google about web drivers of your default browser.)
  4. login using your Google account.
  5. getting on the page of the meet.
  6. finding the message button using selenium (find_element_by_xpath.)
  7. finding text box using selenium (find_element_by_xpath.)
  8. The final step, sending your messages.

If you like my blog post then follow me on LinkedIn.

Choose your Reaction!
Leave a Comment