first of all download and
https://www.python.org/downloads/
install python on your system .
pywhatkit is a python module for sending Whatsapp messages at a certain time
step 1:- install pywhatkit library using command pip install pywhatkit
Step 2:- write code for file what.py file as shown below :-
import pywhatkit
pywhatkit.sendwhatmsg("+91xxxxxxxx",
"how are you sir ji!",
18, 30)
note:-
Before running above what.py file code you must have your WhatsApp logged into the web.whatsapp.com website.
Step 3:-
Run file using command as shown below
https://web.whatsapp.com/send?phone=+919xxxxxx&text=ok%20suraj%20sir%20ji%21
and message will be sent.
note :-
- In the above script, we have specified the recipient phone number on which we want to send the message, then the message to be sent, and then the time at which the message has to be sent. This function follows the 24 hrs time format, hence the time 18:30 is 06:30 PM.
to send mulitple number you can use following code :-
import pywhatkit
nums = ["+918149996597", "+919322437432"]
for x in nums:
pywhatkit.sendwhatmsg(x, "hi", 18, 30)
and for image send
install first pywin32 with following command:-
pip install pywin32
apply following code :-
import pywhatkit
pywhatkit.sendwhats_image("+919834097711", "C:\\Users\\software\\Desktop\\ag.png")
import pywhatkit
# Send a WhatsApp Message to a Contact at 1:30 PM
pywhatkit.sendwhatmsg("+910123456789", "Hi", 13, 30)
# Same as above but Closes the Tab in 2 Seconds after Sending the Message
pywhatkit.sendwhatmsg("+910123456789", "Hi", 13, 30, 15, True, 2)
# Send an Image to a Group with the Caption as Hello
pywhatkit.sendwhats_image("AB123CDEFGHijklmn", "Images/Hello.png", "Hello")
# Send an Image to a Contact with the no Caption
pywhatkit.sendwhats_image("+910123456789", "Images/Hello.png")
# Send a WhatsApp Message to a Group at 12:00 AM
pywhatkit.sendwhatmsg_to_group("AB123CDEFGHijklmn", "Hey All!", 0, 0)
# Send a WhatsApp Message to a Group instantly
pywhatkit.sendwhatmsg_to_group_instantly("AB123CDEFGHijklmn", "Hey All!")
# Play a Video on YouTube
pywhatkit.playonyt("PyWhatKit")
Sign up here with your email
ConversionConversion EmoticonEmoticon