How to send WhatsApp message using Python😎

Now let's setup pywhatkit module and write the code to send WhatsApp message automatically.
Install pywhatkit module:
To install the pywhatkit module, we can use the pip command:
pip install pywhatkit
This command will download the pywhatkit module. It will take some time as it will download some related modules too.
Using pywhatkit module:
To use this python module to send message automatically on WhatsApp at a set time, we need chrome browser and you must have your WhatsApp logged into web.whatsapp.com website.
If you do not have chrome browser, then you can follow the following steps:
Download and extract the current stable release of chrome driver from https://chromedriver.chromium.org/
Open the downloaded file and search for an application named chrome drive, copy its path, for windows, it should look like this - C:/Users/.../chromedriver.exe.
Then call pywhatkit.add_driver_path(path) and pass the copied path as an argument, if the path is valid, a black window along with chrome will open and close.
Now call pywhatkit.load_QRcode() function and scan the QR code.
After following the above steps, you do not have to do anything, just run the final script to send whatsapp message.
To see the setup steps, you can use the pywhatkit.manual() method in your python script.
The code is super simple,
import pywhatkit as kit<br>
kit.sendwhatmsg("<Mobile Number>", "Hi, I am Alan Binu", 18, 21)
In the above code, we have specified the mobile number on which we want to send the message, then the message, and then the time at which the message has to be sent. This module follows the 24 hrs time format, hence the time 18:21 is 06:21 PM.




