Prerequisites:
Now scan the QR code generated using, Whatsapp Web option in your Whatsapp(on Phone).
Allow web.whatsapp.com to send notifications, when pop-up is prompted.
You can see that it starts sending message after few seconds.
Enjoy the trick!
Note:
THANK YOU!
- Mozilla Browser
- Python 2.7.11
- Selenium library in python
from selenium import webdriveror you can find the same code at this link.
import time
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
from selenium.webdriver.common.keys import Keys
binary = FirefoxBinary(r'C:\Program Files (x86)\Mozilla Firefox\firefox.exe') #location of firefox.exe
b = webdriver.Firefox(firefox_binary=binary)
b.get('http://web.whatsapp.com')
raw_input()
print("Success!!!")
elem = b.find_element_by_xpath('//span[contains(text(),"Name of group or your friend!")]')
elem.click()
elem1 = b.find_elements_by_class_name('input')
while True:
elem1[1].send_keys('Message That you want to send!')
b.find_element_by_class_name('send-container').click()
- You need to make sure that location of firefox library is correct!
- Check the name of your friend or group that you want to target
- you can add whatever message you want to send as a message in send_key(//here).
Now scan the QR code generated using, Whatsapp Web option in your Whatsapp(on Phone).
Allow web.whatsapp.com to send notifications, when pop-up is prompted.
You can see that it starts sending message after few seconds.
Enjoy the trick!
Note:
- Selenium installation on windows
- start command prompt
- C:\Python27\Scripts\pip.exe install -U selenium run this command, you can change the location as per your configuration
from selenium import webdriver browser=webdriver.Firefox() browser.get('http://www.google.com') #use this to check whether installation was successful or not
- for python you can use any tool and python 2.7 is preferred.
Regards,
Saurabh Mardikar
awesome.. it works.. thanks for the trick
ReplyDeleteMake sure you do not try to send large number of messages in one go. WhatsApp keeps monitoring suspicious activities and sometimes temporarily bans the user.
ReplyDeleteCAN U TELL ME FROM WHERE TO DOWNLOAD THE SELENIUM SCRIPT?
ReplyDeleteYou don't download 'Selenium Script'. You need to install it, you can do that directly from command prompt using,
Delete"pip install selenium" command. Similarly you can download all the required libraries using pip install pkg_name.
Thanks for the post. You have explained the topic in very simple and step by step.
ReplyDeleteWhatsapp Platform For Business
And Im running from a standard users account with strict limitations, which I think may be the limiting factor, but Im running the cmd as the system I am currently working on. https://python.engineering/python-convert-list-of-nested-dictionary-into-pandas-dataframe/
ReplyDelete