Giter VIP home page Giter VIP logo

whatsapp-bulk-messenger's Introduction

Whatsapp-Bulk-Messenger

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

Note: The current program is limited to sending only TEXT message

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 demonstrating how the app works. Please reach out to me on email for more enquiry. Join the google group here and telegram group here.

Requirements

  • Python >= 3.6
  • Chrome headless is installed by the program automatically

Setup

  1. Install python - >=v3.6
  2. Run pip install -r requirements.txt

Steps

  1. Enter the message you want to send inside message.txt file.
  2. Enter the list of numbers line-separated in numbers.txt file.
  3. Run python automator.py.
  4. Once the program starts, you'll see the message in message.txt and count of numbers in the numbers.txt file.
  5. After a while, Chrome should pop-up and open web.whatsapp.com.
  6. Scan the QR code to login into whatsapp.
  7. Press Enter to start sending out messages.
  8. Sit back and relax!

Funding

If you like this app, I'd appreciate it if you could make a donation via Buy Me a Coffee or PayPal.Me.

whatsapp-bulk-messenger's People

Contributors

254sidney avatar anirudhbagri avatar prateekgautam21 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

whatsapp-bulk-messenger's Issues

Ban

Hello, I was banned from whatsapp. I believe it is easy to detect selenium through the browser

Chats not visible

"Press enter after login into WhatsApp Web and your chats are visible"
As for me, when i press enter nothing happens

How Add Image In Message

HI, i want to send image with message but, this script sending message using text document. how can we add image in message to send with text.

License

I would like use your code in a Commercial Use.
Can i use your code as a basis for a commercial project? I will modify the code, but I will use it as base of one module the project. You authorize this please?

Messages not sending

First of all, thank you for making this great code. You are a genius.

I have a problem. In my case, the code runs fine. But whatsapp opens, lads the message but it never gets sent. How do I deal with this issue?

Failed to send message to 'phone-number'

I have chrome V86 so I replaced google driver version to V86 but when I run the Command I get this log in command
DevTools listening on ws://127.0.0.1:57226/devtools/browser/aa42d0f7-2ee7-4465-b654-a18e1479024b [6700:1244:1101/100847.869:ERROR:device_event_log_impl.cc(208)] [10:08:47.868] Bluetooth: bluetooth_adapter_winrt.cc:1076 Getting Default Adapter failed.

But everything goes well after pressing the enter button Whatsapp chat opens with message and after delay of 30 sec, this error message pops in command
Failed to send message to #phone number

Class button send

File: automator.py

line 77
Old class whatsapp button

click_btn = WebDriverWait(driver, delay).until(EC.element_to_be_clickable((By.XPATH, "//button[@Class='_4sWnG']")))

New class whatsapp button
click_btn = WebDriverWait(driver, delay).until(EC.element_to_be_clickable((By.XPATH, "//button[@Class='tvf2evcx oq44ahr5 lb5m6g5c svlsagor p2rjqpw5 epia9gcq']")))

what if the number is not valide ?

the script is working when the number is valide but when a number is not whatsapp is showing a message with ok button!
i tried to fix that with :
from selenium.webdriver import ActionChains

ActionChains(browser).click(element).perform()

but i am getting some errors

nb: i tried click but class but not working

Adding media

In the description u have mentioned that there exist another version of this project which supports media.Can you pls provide more info about that?

Alright | Give it a try

Hi there

Great project, based on what you're doing you might be interested in adapting the package Alright for the WhatsApp Automation.

Here a snippet how you do bulk messaging provided you're using alright package.

>>> from alright import WhatsApp
>>> messenger = WhatsApp()
>>> messenger.find_user('2557xxxxxz')
>>> messages = ['Morning my love', 'I wish you a good night!']
>>> for message in messages:  
        messenger.send_message(message)   

Thank you Kalebu

Bypass if a number is not active

I am a noob in programming, but I could actually run the script and send particular messages to my contacts (over 1000 contacts, therefore using script).
My problem is that a lot of numbers in my contact lists don't have whatsapp with their numbers. This creates an issue as the program stops and then I have to manually click on whatsapp interface and then press enter on the command line. Can you suggest how one can bypass this?

Bug fix of binary file of chrome and emoji support issue

from selenium import webdriver
from selenium.webdriver.common.alert import Alert
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException, UnexpectedAlertPresentException, NoAlertPresentException
from time import sleep
from urllib.parse import quote
from sys import platform

options = webdriver.ChromeOptions()
options.binary_location="C:\Program Files\Google\Chrome\Application\chrome.exe"

print("")
print("
")
print("***** ")
print("
THANK YOU FOR USING WHATSAPP BULK MESSENGER ")
print("
This tool was built by Anirudh Bagri ")
print("
www.github.com/anirudhbagri ")
print("
")
print("
")
print("
**********")

f = open("message.txt", encoding='UTF-8')
message = f.read()
f.close()

print("##########################################################")

print("##########################################################")
message = quote(message)

numbers = []
f = open("numbers.txt", "r")
for line in f.read().splitlines():
if line != "":
numbers.append(line)
f.close()
total_number=len(numbers)
print("##########################################################")
print('\nWe found ' + str(total_number) + ' numbers in the file')
print("##########################################################")
print()
delay = 30

if platform == "win32":
driver = webdriver.Chrome("drivers\chromedriver.exe", chrome_options=options)
else:
driver = webdriver.Chrome("./drivers/chromedriver", options=options)
print('Once your browser opens up sign in to web whatsapp')
driver.get('https://web.whatsapp.com')
input("Press ENTER after login into Whatsapp Web and your chats are visiable .")
for idx, number in enumerate(numbers):
if number == "":
continue
print('{}/{} => Sending message to {}.'.format((idx+1), total_number, number))
try:
url = 'https://web.whatsapp.com/send?phone=91' + number + '&text=' + message
driver.get(url)
try:
click_btn = WebDriverWait(driver, delay).until(EC.element_to_be_clickable((By.CLASS_NAME , '_1E0Oz')))
except (UnexpectedAlertPresentException, NoAlertPresentException) as e:
print("alert present")
Alert(driver).accept()
sleep(1)
click_btn.click()
sleep(3)
print('Message sent to: ' + number)
except Exception as e:
print('Failed to send message to ' + number + str(e))

invalid number

i got invalid number message when i run your script

line-saprated number list which look like
87xxxxxx6
88xxxxxxx8

and so on

am i doing something wrong

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.