Sending Whatsapp Message Using Whatsapp Web and Selenium

January 22, 2021
Python webdriver selenium gecko whatsapp

Long story short, a few days ago me and my friends need to send/blast an information about event details to our community members through WhatsApp messenger. Instead of sending to all recipients one-by-one and taking too long time to get the job done, I made simple scripts to automate sending a new WhatsApp message through WhatsApp web with Selenium and webdriver(gecko).

The Idea was very simple, I utilize webdriver to open a new chat-box, then use selenium to find the textbox, paste the text and hit the send button or sending enter key.

the script is very simple, you just need to prepare the list of recipients and the string content, at the beginning you need to scan QR to authenticate your WhatsApp Web.

The scipt can be seen below, hopefully it helps you all, but bear in mind. do not use this script for flooding or spaming to random users, thank you

ps. the gist can be accessed here https://gist.github.com/yudanta/0af837f273aabb7b44d1358d10fe6c7c

comments powered by Disqus