Skip to content

Commit e1d4299

Browse files
authored
Merge pull request HarshCasper#217 from bagofcodes/whatsappbomber
Whatsappbomber
2 parents 7264b22 + cd06394 commit e1d4299

File tree

5 files changed

+146
-0
lines changed

5 files changed

+146
-0
lines changed

WhatsappSmsBomber/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Whatsapp SMS Bomber App
2+
3+
```
4+
5+
As the name suggest this app is used to automate your task in sending multiple message to either single user or multiple users in
6+
your contact list. Based solely on the concept this app can also be used to send invitation message or notice message to all the
7+
users in your contacts.
8+
9+
```
10+
### Demo of my app
11+
12+
![demo](https://github.com/bagofcodes/Rotten-Scripts/blob/whatsappbomber/WhatsappSmsBomber/resources/Screenshot%20(113).png)
13+
14+
### Requirements
15+
16+
```
17+
- Python 3.6 or above
18+
- Google Chrome
19+
- Selenium library
20+
- Chrome Driver downloaded from the url given below in the links section based upon the version of Chrome
21+
you are using.
22+
23+
```
24+
25+
### How to Use
26+
27+
```
28+
- Install Python 3.6 or above from the url given in the links section.
29+
- Run "pip install selenium" in your cmd terminal to install Selenium.
30+
- Download the chrome webdriver from the above Url and place that in "C:\WebDriver\bin".
31+
- Create the WebDriver and bin folder and place your downloaded file and add that to your path in enviroment variable.
32+
- Clone the repo in your local machine.
33+
- Edit the "mycontacts.py" and add your contacts in the given format
34+
- Run the program.Enjoy
35+
```
36+
37+
### Links
38+
[To download ChromeDriver](https://chromedriver.chromium.org/downloads)
39+
[Official Website to download Python](https://www.python.org/downloads/)

WhatsappSmsBomber/main.py

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
from selenium import webdriver
2+
from selenium.webdriver.common.keys import Keys
3+
from selenium.common.exceptions import NoSuchElementException
4+
import mycontacts
5+
import tkinter as tk
6+
from tkinter import *
7+
import xpath
8+
import time
9+
10+
#Function checking whether the given user exists in the user's whatsapp contact list
11+
def checkuser(str):
12+
try:
13+
driver.find_element_by_xpath(str)
14+
except NoSuchElementException:
15+
return False
16+
return True
17+
# Taking all the Credentials from the user
18+
contact_name=[]
19+
print("\n\nEnter the name of the contact you want to send message to (Type 'ALL' if you want to send message to all your contacts: )")
20+
print(R"For multiple contacts use newline and type 'stop' at the end to stop adding contacts: ")
21+
while(1):
22+
a=input()
23+
if(a == "stop"):
24+
break
25+
contact_name.append(a)
26+
27+
print("Enter the message you want to send:- ", end = " ")
28+
message= input()
29+
30+
print("Enter the number of times you want to bomb the message to your contact: ", end= " ")
31+
count_message=int(input())
32+
33+
34+
#defining the driver for the chrome
35+
driver= webdriver.Chrome()
36+
d1= driver.get("https://web.whatsapp.com/")
37+
driver.maximize_window()
38+
time.sleep(10)
39+
40+
#If the user chooses ALL then the message will be sent to all the contacts added in mycontacts.py
41+
if("ALL" in contact_name):
42+
for contact in mycontacts.my_contacts:
43+
44+
#locating the chat icon using xpath
45+
chat=driver.find_element_by_xpath(xpath.newchat_xpath)
46+
chat.click()
47+
48+
#locating the search box using xpath and adding the contact to search
49+
search=driver.find_element_by_xpath(xpath.search_xpath)
50+
search.send_keys(contact)
51+
time.sleep(1)
52+
53+
#Checking whether the contact exist or not
54+
if(checkuser("//span[@title='{}']".format(contact)) == False):
55+
continue
56+
57+
#Searching the contact and clicking on it
58+
find_user =driver.find_element_by_xpath("//span[@title='{}']".format(contact))
59+
find_user.click()
60+
time.sleep(1)
61+
62+
#Finding the box to type the message and clicking on it
63+
find_message=driver.find_element_by_xpath(xpath.message_xpath)
64+
find_message.click()
65+
time.sleep(1)
66+
67+
#Sending the messages on the basis of count given by the user
68+
for i in range(count_message):
69+
find_message.send_keys(message)
70+
driver.find_element_by_xpath(xpath.sendbutton_xpath).click()
71+
time.sleep(0.5)
72+
time.sleep(1)
73+
#Else the messages will be sent to the users mentioned in the input
74+
else:
75+
for contact in contact_name:
76+
chat=driver.find_element_by_xpath(xpath.newchat_xpath)
77+
chat.click()
78+
79+
search=driver.find_element_by_xpath(xpath.search_xpath)
80+
search.send_keys(contact)
81+
time.sleep(1)
82+
83+
if(checkuser("//span[@title='{}']".format(contact)) == False):
84+
continue
85+
86+
find_user =driver.find_element_by_xpath("//span[@title='{}']".format(contact))
87+
find_user.click()
88+
time.sleep(1)
89+
90+
find_message=driver.find_element_by_xpath(xpath.message_xpath)
91+
find_message.click()
92+
time.sleep(1)
93+
94+
for i in range(count_message):
95+
find_message.send_keys(message)
96+
driver.find_element_by_xpath(xpath.sendbutton_xpath).click()
97+
time.sleep(0.5)
98+
time.sleep(1)
99+
100+
print("Sms Bombing Completed...!!!!")

WhatsappSmsBomber/mycontacts.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
my_contacts= ["Ankita","Bhai"]
2+
#Note that the names you add here should match the format of your contact list in your whatsapp
Loading

WhatsappSmsBomber/xpath.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
newchat_xpath= "//*[@id='side']/header/div[2]/div/span/div[2]"
2+
search_xpath= "//*[@id='app']/div/div/div[2]/div[1]/span/div/span/div/div[1]/div/label/div/div[2]"
3+
#user_xpath= "//span[@title='{}']"
4+
message_xpath= "//*[@id='main']/footer/div[1]/div[2]/div/div[2]"
5+
sendbutton_xpath= "//*[@id='main']/footer/div[1]/div[3]"

0 commit comments

Comments
 (0)