This project allows you to send bulk WhatsApp messages using a CSV file containing phone and messages. It uses Selenium to automate WhatsApp Web.
- Send text messages to multiple contacts.
- Optionally attach an image to the messages.
- Uses Chrome user profile to maintain login sessions.
- Python 3.x
- Google Chrome browser
- ChromeDriver
- Required Python packages (listed in
requirements.txt)
-
Clone the repository:
git clone https://github.com/shivamc489/bulk-whatsapp-message.git cd bulk-whatsapp-message -
Install the required Python packages:
pip install -r requirements.txt
-
Download ChromeDriver:
- Ensure that the ChromeDriver version matches your installed Chrome browser version.
- You can download ChromeDriver from here.
-
Prepare your CSV file:
- The CSV file should have the following columns:
Phone: The phone number of the recipient (in international format without+).Message: The message to be sent.
Phone,Message 1234567890,Hello John! Checkout our app at https://github.com/Shivamc489/bulk-whatsapp-message 0987654321,Hi Jane! Checkout our app at https://github.com/Shivamc489/bulk-whatsapp-message
- The CSV file should have the following columns:
-
Run the script:
python bulk_whatsapp_message.py -d path/to/your/leads.csv [-i path/to/image.jpg] [-l]
-d, --data: Path to the CSV file containing contacts and messages (required).-i, --image: Path to the image to send (optional).-l, --login: Force login to WhatsApp Web (optional).
-
Login to WhatsApp Web:
- If running for the first time or using the
-lflag, you will need to scan the QR code from your phone to log in to WhatsApp Web.
- If running for the first time or using the
python bulk_whatsapp_message.py -d leads.csv -i image.jpgThis command will send the messages listed in leads.csv and attach image.jpg to each message.
- Ensure that the phone numbers in the CSV file are in the correct international format.
- The script uses a Chrome user profile stored in the
chrome_profiledirectory to maintain login sessions. If you encounter login issues, you can delete this directory and re-run the script with the-lflag to re-login.
This project is licensed under the MIT License. See the LICENSE file for details.