Thursday, December 1, 2016

Whatsapp Hacks!

Prerequisites:


  1. Mozilla Browser
  2. Python 2.7.11
  3. Selenium library in python
  4. Whatsapp 
So, you start by this code in python,

from selenium import webdriver
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()
or you can find the same code at this link


  • 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).
Once you run this code wait till the firefox is opened with https://web.whatsapp.com

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: 


  1.  Selenium installation on windows
    1.  start command prompt
    2.  C:\Python27\Scripts\pip.exe install -U selenium run this command, you can change the location as per your configuration
    3. from selenium import webdriver
      browser=webdriver.Firefox()
      browser.get('http://www.google.com')                                                           #use this to check whether installation was successful or not
  2. for python you can use any tool and python 2.7 is preferred.


THANK YOU!

Regards,
Saurabh Mardikar


6 comments:

  1. awesome.. it works.. thanks for the trick

    ReplyDelete
  2. Make 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.

    ReplyDelete
  3. CAN U TELL ME FROM WHERE TO DOWNLOAD THE SELENIUM SCRIPT?

    ReplyDelete
    Replies
    1. You don't download 'Selenium Script'. You need to install it, you can do that directly from command prompt using,
      "pip install selenium" command. Similarly you can download all the required libraries using pip install pkg_name.

      Delete
  4. Thanks for the post. You have explained the topic in very simple and step by step.

    Whatsapp Platform For Business

    ReplyDelete
  5. 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