This tool makes adding multiple people to a WhatsApp group much easier.
To prevent spam, WhatsApp doesn’t allow you to add someone not there in your contact list, to a group. So you'd end up wasting time manually adding all the numbers that you want to your phone. Or you have to send them the group link over email etc., which they might not immediately respond to.
This tool allows you to directly send the link to a list of people, on WhatsApp itself, who can instantly join your group. 🎉
-
Google Chrome : I expect you've it already installed.
-
Chromedriver : Please follow the commands to download Chromedriver or from the official download page.
wget https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
Once downloaded you can configure it by using:
sudo mv chromedriver /usr/bin/chromedriver
sudo chown root:root /usr/bin/chromedriver
sudo chmod +x /usr/bin/chromedriver
Process for installing Chromedriver on Windows is also the same as above.
You may consider using virtualenv to create isolated Python environments.
Git clone
this project from your terminal or download the zip from GitHub web.- Activate your virtual environment if you made one, using
source <venv dir>/activate
cd
to the project folder.- Install the requirements using
pip install -r requirements.txt
You may use any or all of the following methods to enter the mobile numbers
- When you execute
python run.py
, you can enter any number of comma separated 10 digit phone numbers at the prompt, at once. - Update the variable
phone
with a comma separated list of phone numbers. - Make a file called
numbers.txt
which will store all the 10 digit numbers, each on a line. To use this feature, uncomment the three commented lines inrun.py
for input from file.
- Open the file
run.py
and update the variablemsg
with the message you want to send to all the numbers. - Make sure you've added the numbers properly. Make sure there are no duplicates.
- When the automated Chrome browser window opens up, be ready to scan the QR code with your phone to sign in to WhatsApp Web, more info on how to do this can be found in the WhatsApp Web faq.
- Go grab a 🍩, you've earned it.
- You can add individual messages for each contact, however that will require elementary knowledge in Python, this could be done using a file for input, and might be included in future releases.
- For using country codes other than India but only one country, please change it in the
url
string inrun.py
. - For multiple countries, please remove the 91 from
url
string, and prepend each number directly with the country code, without plus symbol, for example 19876543210, where 1 is prepended for the US. - You can use any browser, not just Chrome as long as it has a supporting webdriver and install it manually.
This program uses a CSS Selector to find out where exactly to write the message, just like a human would. And that keeps changing over time based on how WhatsApp Web is designed. So all we have to do is update the CSS Selector in the code, by doing the following:
- Right click on the white space in WhatsApp Web where you type the message,
- Press Inspect element
- From the inspector in chrome or any browser you're using, copy the CSS selector
- Update the
css_selector
variable in the code.
That's it. 😃
Use the urllib.parse.quote
function instead of the urllib.quote
as in Py2, and obviously use brackets for print. That's it!
Update: Now it supports both versions, just uncomment the library you need in imports. Defaults to Py3. Py2 might have issues due to dependencies dropping support for it.
This code is in no way affiliated with, authorized, maintained, sponsored or endorsed by WhatsApp or any of its affiliates or subsidiaries. This is an independent and unofficial software. The developers claim no responsibility and offer no warranty.