Skip to content

Python script for automated bulk WhatsApp Messaging with an option to send an image as an attachment.

License

Notifications You must be signed in to change notification settings

arkisoul/whatsapp-bulk-message-automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Automated Bulk WhatsApp Messages

It is a python script that sends WhatsApp message automatically from WhatsApp web application. It can be configured to send advertising messages to customers. It read data from a Google sheet and send a configured message to people.

Prerequisites

In order to run the python script, your system must have the following programs/packages installed and the contact number either should be saved in your phone or could be a new number.

Approach

  • User scans web QR code to log in into the WhatsApp web application for the new session.
  • The script reads a customized message from the Google sheet.
  • The script reads rows one by one and searches that contact number in the web search box if the contact number found on WhatsApp then it will send a configured message otherwise it creates url for new number. Then it reads next row.
  • Loop execute until and unless all rows complete.

Process

  • Clone this repository
git clone https://github.com/arkisoul/whatsapp-bulk-message-automation
  • Change directory
cd whatsapp-bulk-message-automation
  • Use any virtualenv for python venv, pipenv, conda and install application dependencies
pip install -e requirements.txt
  • Use below command to send bulk message
    • Without attachment
      python app/app.py SHEET_ID SHEET_NAME SHEET_GID
      
    • With attachment
      python app/app.py --image-path='absolute/path/to/the/image' SHEET_ID SHEET_NAME SHEET_GID
      

Google Sheet Reference

Example Google sheet for your reference https://docs.google.com/spreadsheets/d/1fB1UHWOHXGTWQJ208UEiermUZ6MfOTZpqI_Tea8Vwqw/edit#gid=1484715859

  • Google Sheet ID = 1fB1UHWOHXGTWQJ208UEiermUZ6MfOTZpqI_Tea8Vwqw
  • Google Sheet Name = Customers
  • Google Sheet Gid = 1484715859

Note: The script may not work in case if the HTML of web WhatsApp is changed.

Inspiration

This script is inspired from @inforkgodara repo and updated to read a Google sheet and send to any whatsapp number.