├── .github └── FUNDING.yml ├── .gitignore ├── README.md ├── automator.py ├── message.txt ├── numbers.txt └── requirements.txt /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: anirudhbagri # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | polar: # Replace with a single Polar username 14 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /venv -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Whatsapp-Bulk-Messenger 2 | 3 | Whatsapp Bulk Messenger automates sending of messages via Whatsapp Web. The tool can you used to send whatsapp message in bulk. Program uses runs through a list of numbers provided in numbers.txt and then tries to send a prediefined (but templated) message to each number in the list. It can also read other columns from the number csv to populate template specific words and then send out a personalized message to the number 4 | 5 | Note: The current program is limited to sending only TEXT message 6 | 7 | Note: Another version of similar project is available which supports sending media and documents along with text. As per many requests, I have added a [video here](https://youtu.be/NNkAh5sLEok) demonstrating how the app works. Please reach out to me on [email](mailto:bagrianirudh@gmail.com) for more enquiry. Join the [google group here](https://groups.google.com/g/whatsapp-bulker/) and [telegram group here](https://t.me/whatsapp_bulker). 8 | 9 | # Requirements 10 | 11 | * Python >= 3.6 12 | * Chrome headless is installed by the program automatically 13 | 14 | # Setup 15 | 16 | 1. Install python - >=v3.6 17 | 2. Run `pip install -r requirements.txt` 18 | 19 | # Steps 20 | 21 | 1. Enter the message you want to send inside `message.txt` file. 22 | 2. Enter the list of numbers line-separated in `numbers.txt` file. 23 | 3. Run `python automator.py`. 24 | 4. Once the program starts, you'll see the message in message.txt and count of numbers in the numbers.txt file. 25 | 5. After a while, Chrome should pop-up and open web.whatsapp.com. 26 | 6. Scan the QR code to login into whatsapp. 27 | 7. Press `Enter` to start sending out messages. 28 | 8. Sit back and relax! 29 | 30 | ### Funding 31 | 32 | If you like this app, I'd appreciate it if you could make a donation via [Buy Me a Coffee](https://www.buymeacoffee.com/anirudhbagri) or [PayPal.Me](https://paypal.me/AnirudhBagri?locale.x=en_GB). 33 | -------------------------------------------------------------------------------- /automator.py: -------------------------------------------------------------------------------- 1 | from selenium import webdriver 2 | from selenium.webdriver.chrome.options import Options 3 | from selenium.webdriver.support.ui import WebDriverWait 4 | from selenium.webdriver.support import expected_conditions as EC 5 | from selenium.webdriver.common.by import By 6 | from webdriver_manager.chrome import ChromeDriverManager 7 | from time import sleep 8 | from urllib.parse import quote 9 | import os 10 | 11 | options = Options() 12 | options.add_experimental_option("excludeSwitches", ["enable-logging"]) 13 | options.add_argument("--profile-directory=Default") 14 | options.add_argument("--user-data-dir=/var/tmp/chrome_user_data") 15 | 16 | os.system("") 17 | os.environ["WDM_LOG_LEVEL"] = "0" 18 | class style(): 19 | BLACK = '\033[30m' 20 | RED = '\033[31m' 21 | GREEN = '\033[32m' 22 | YELLOW = '\033[33m' 23 | BLUE = '\033[34m' 24 | MAGENTA = '\033[35m' 25 | CYAN = '\033[36m' 26 | WHITE = '\033[37m' 27 | UNDERLINE = '\033[4m' 28 | RESET = '\033[0m' 29 | 30 | print(style.BLUE) 31 | print("**********************************************************") 32 | print("**********************************************************") 33 | print("***** ******") 34 | print("***** THANK YOU FOR USING WHATSAPP BULK MESSENGER ******") 35 | print("***** This tool was built by Anirudh Bagri ******") 36 | print("***** www.github.com/anirudhbagri ******") 37 | print("***** ******") 38 | print("**********************************************************") 39 | print("**********************************************************") 40 | print(style.RESET) 41 | 42 | f = open("message.txt", "r", encoding="utf8") 43 | message = f.read() 44 | f.close() 45 | 46 | print(style.YELLOW + '\nThis is your message-') 47 | print(style.GREEN + message) 48 | print("\n" + style.RESET) 49 | message = quote(message) 50 | 51 | numbers = [] 52 | f = open("numbers.txt", "r") 53 | for line in f.read().splitlines(): 54 | if line.strip() != "": 55 | numbers.append(line.strip()) 56 | f.close() 57 | total_number=len(numbers) 58 | print(style.RED + 'We found ' + str(total_number) + ' numbers in the file' + style.RESET) 59 | delay = 30 60 | 61 | driver = webdriver.Chrome(ChromeDriverManager().install(), options=options) 62 | print('Once your browser opens up sign in to web whatsapp') 63 | driver.get('https://web.whatsapp.com') 64 | input(style.MAGENTA + "AFTER logging into Whatsapp Web is complete and your chats are visible, press ENTER..." + style.RESET) 65 | for idx, number in enumerate(numbers): 66 | number = number.strip() 67 | if number == "": 68 | continue 69 | print(style.YELLOW + '{}/{} => Sending message to {}.'.format((idx+1), total_number, number) + style.RESET) 70 | try: 71 | url = 'https://web.whatsapp.com/send?phone=' + number + '&text=' + message 72 | sent = False 73 | for i in range(3): 74 | if not sent: 75 | driver.get(url) 76 | try: 77 | click_btn = WebDriverWait(driver, delay).until(EC.element_to_be_clickable((By.XPATH, "//button[@data-testid='compose-btn-send']"))) 78 | except Exception as e: 79 | print(style.RED + f"\nFailed to send message to: {number}, retry ({i+1}/3)") 80 | print("Make sure your phone and computer is connected to the internet.") 81 | print("If there is an alert, please dismiss it." + style.RESET) 82 | else: 83 | sleep(1) 84 | click_btn.click() 85 | sent=True 86 | sleep(3) 87 | print(style.GREEN + 'Message sent to: ' + number + style.RESET) 88 | except Exception as e: 89 | print(style.RED + 'Failed to send message to ' + number + str(e) + style.RESET) 90 | driver.close() 91 | -------------------------------------------------------------------------------- /message.txt: -------------------------------------------------------------------------------- 1 | Hello World, 2 | 3 | This is my text to you from automated messaging system. 4 | 5 | Thank You 6 | -------------------------------------------------------------------------------- /numbers.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | selenium==3.141.0 2 | webdriver-manager==3.4.2 3 | --------------------------------------------------------------------------------