-
Notifications
You must be signed in to change notification settings - Fork 135
Expand file tree
/
Copy pathSend_Whatsapp_msgs.py
More file actions
30 lines (23 loc) · 882 Bytes
/
Copy pathSend_Whatsapp_msgs.py
File metadata and controls
30 lines (23 loc) · 882 Bytes
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
#Before Running, Please do
#pip install webbrowser
#pip install pyautogui
import webbrowser as web
import pyautogui as pyta
import time
lel=input('Is Your Qr Code Scanned on ur default Browser? {Y/N}')
if lel=='Y':
print("in 10 seconds, Please scan the qr code visible on your screen with whatsapp scanner")
time.sleep(10)
web.open("https://web.whatsapp.com")
print("cool")
else:
contact=input("Enter the Contact you want to send a message to:(please insert country code too")
message=input("Enter the Message You wanna pass on")
def send_msg(number,message):
print("Contact=",contact,"\n","and Message =",message,"would be sent in 20 seconds")
time.sleep(10)
web.open('https://web.whatsapp.com/send?phone=%27+{}+%27&text='.format(number))
time.sleep(20)
pyta.write(message)
pyta.press('enter')
send_msg(contact,message)