This Python script automates the process of sending bulk WhatsApp messages using phone numbers from a CSV file. It uses pywhatkit
to send messages and handles failures by logging them into a file.
- Sends bulk WhatsApp messages instantly.
- Logs any failed attempts into
failed_numbers.txt
for further review. - Automates interaction using
pyautogui
for mouse clicks andkeyboard
for sending messages.
- WhatsApp Web should be linked to your phone and open in your default browser.
- Install the required Python dependencies from
requirements.txt
.
Use the following command to clone the repository to your local machine:
git clone https://github.com/yourusername/whatsapp-bulk-messaging.git
cd whatsapp-bulk-messaging
- Windows:
pip install -r requirements.txt
- Linux:
Note: pip3 might not be installed by-default in some of the Linux distros. Please install it before installing the dependencies To install pip3 type:
pip3 install -r requirements.txt
sudo apt-get install python3-pip # If you are in Debian-based disto sudo pacman -S python3-pip # If you are in Arch-based distro sudo dnf install python3-pip # If you are in Fedora sudo yum install python3-pip # If you are in CentOS/RHEL
Prepare a CSV file named phone_no.cs
v with a column phone_no
containing the phone numbers without the country code.
Example phone_no.csv
:
phone_no
0123456789
Once the setup is done, run the script:
python main.py
Any failed messages will be logged into failed_numbers.txt
for retry later.
You can modify the message within the script:
message = "Hi guys I am From Robotics Club So As your Team Leader Filled Our Form Please Join this Group for more Information\n"
The following Python libraries are required to run the script:
pywhatkit
: For sending WhatsApp messages.pyautogui
: For automating mouse and keyboard actions.keyboard
: For simulating key presses.pandas
: For processing the CSV file.
pywhatkit==5.4
pyautogui==0.9.53
keyboard==0.13.5
pandas==1.5.3
You can install all dependencies with:
pip install -r requirements.txt
- Message Content: Update the message content directly in the script if you need to send a different message.
- Phone Number Format: Ensure that phone numbers are stored in phone_no.csv without the country code. The country code is added in the script (+91 is currently used for India).
This project is licensed under the MIT License. See the LICENSE file for more details.
Special thanks to the open-source libraries: