-
-
Notifications
You must be signed in to change notification settings - Fork 203
/
Copy pathmessages-sender.py
80 lines (59 loc) · 2.39 KB
/
messages-sender.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/python3
'''
Author- RIZWAN AHMAD
download https://github.com/mozilla/geckodriver/releases
set path paste binary file /usr/local/bin
sudo apt-get install libnotify-bin
Please Dont't use it in spam messages.
'''
from selenium.webdriver.firefox.options import Options
from selenium import webdriver
import psutil,os
from PIL import Image
from time import strftime,sleep
print("Please Wait Starting whatsapp-bomber")
os.system('notify-send "-i" call-start "Whatsapp bomber Start" "Developed By RIZWAN AHMAD([email protected])"')
options = Options()
options.headless = True
driver = webdriver.Firefox(options=options)
driver.get("http://web.whatsapp.com")
def close():
for proc in psutil.process_iter():
if proc.name() == "display":
proc.kill()
print("QR Code Generating")
sleep(2)
with open('qr.png', 'wb') as file:
file.write(driver.find_element_by_xpath('/html/body/div[1]/div/div/div[2]/div[1]/div/div[2]/div/canvas').screenshot_as_png)
image = Image.open('qr.png')
print("Sucessfully QR code genereted")
image.show()
while True:
try:
chat = driver.find_element_by_xpath("/html/body/div[1]/div/div/div[3]/div/header/div[2]/div/span/div[2]/div")
close()
chat.click()
print("Sucessfully QR Code Scanned")
sleep(2)
search = driver.find_element_by_xpath("/html/body/div[1]/div/div/div[2]/div[1]/span/div/span/div/div[1]/div/label/input")
search.click()
sleep(2)
name = input("Please enter Contacts name saved in your Phone:>>> ")
search.send_keys(name)
sleep(2)
print("Search Successfully")
open = driver.find_element_by_xpath("/html/body/div[1]/div/div/div[2]/div[1]/span/div/span/div/div[2]/div[1]/div/div/div[2]/div/div")
open.click()
sleep(2)
n=int(input("Enter no. of messages don't more than 100 maybe whatsapp will suspend your account: "))
message=input("Enter Your Messages: ")
type = driver.find_element_by_xpath("/html/body/div[1]/div/div/div[4]/div/footer/div[1]/div[2]/div/div[2]")
send = driver.find_element_by_xpath("/html/body/div[1]/div/div/div[4]/div/footer/div[1]/div[3]")
for i in range(n):
type.send_keys(message)
send.click()
print(i+1,": Successfully Send")
except:
print(":Please Scan QR code or something error occured:")
sleep(2)
pass