Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.

Simple WhatsApp Automation Script (Send a Message)

Last updated on 5 days ago
K
KevinMember
Posted 5 days ago
Here’s a **basic WhatsApp automation sample program** using **Python** and **pywhatkit**, a popular library that allows you to send messages via WhatsApp Web.
> ✅ This works with **WhatsApp Web**, so your computer must be connected to the internet and logged into WhatsApp Web when the message sends.
---
## 🚀 Simple WhatsApp Automation Script (Send a Message)

### ✅ Step 1: Install pywhatkit

bash
pip install pywhatkit

---
### ✅ Step 2: Python Code to Send a WhatsApp Message

python
import pywhatkit as kit
import datetime

# Set the time 1 minute ahead so WhatsApp Web has time to open
now = datetime.datetime.now()
hour = now.hour
minute = now.minute + 1

# Parameters
phone_number = '+1234567890' # Replace with recipient's number (with country code)
message = 'Hello from Python! This is an automated message 🤖'

# Send the message
kit.sendwhatmsg(phone_number, message, hour, minute)

---
### ⚠️ Important Notes:

* Your browser will open automatically to WhatsApp Web.
* You must **scan the QR code** the first time or be already logged in.
* pywhatkit.sendwhatmsg() waits for the exact time to send the message.
---
## 🧠 Cool Extensions (Ideas for Automation):

1. **Schedule daily messages** with a task scheduler (e.g., cron, Windows Task Scheduler)
2. **Read messages from a CSV or database** and loop through them
3. **Send updates or reports automatically** (e.g., weather, stock prices, reminders)

---

## ⛔ Limitations:

* Can’t receive messages with pywhatkit (send-only).
* It’s not “instant” – messages are sent via browser automation.
* For full automation including reading messages, you’ll need:

* **WhatsApp Business API** (very limited access)
* Or **unofficial automation tools** (risk of ban – not recommended for production)

---
You can view all discussion threads in this forum.
You cannot start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You cannot download attachments in this forum.
Sign In
Not a member yet? Click here to register.
Forgot Password?
Users Online Now
Guests Online 3
Members Online 0

Total Members: 17
Newest Member: apitech