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