Python to automate What's App messages
Python to automate What's App messages
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.
LIKE BELOW SCRIPT WILL RUN AUTOMATICALLY::::
(venv) C:\Users\RCF\PycharmProjects\pywhatkitWhatsAppAutomate>pip install pywhatkit
Collecting pywhatkit
Downloading pywhatkit-3.9-py3-none-any.whl (9.1 kB)
Collecting beautifulsoup4
Downloading beautifulsoup4-4.9.3-py3-none-any.whl (115 kB)
|████████████████████████████████| 115 kB 6.8 MB/s
Collecting wikipedia
Downloading wikipedia-1.4.0.tar.gz (27 kB)
Collecting pyautogui
Downloading PyAutoGUI-0.9.52.tar.gz (55 kB)
|████████████████████████████████| 55 kB 909 kB/s
Collecting Pillow
Downloading Pillow-8.1.0-cp39-cp39-win_amd64.whl (2.2 MB)
|████████████████████████████████| 2.2 MB 6.4 MB/s
Collecting requests
Downloading requests-2.25.1-py2.py3-none-any.whl (61 kB)
|████████████████████████████████| 61 kB 773 kB/s
Collecting soupsieve>1.2
Downloading soupsieve-2.1-py3-none-any.whl (32 kB)
Collecting pymsgbox
Downloading PyMsgBox-1.0.9.tar.gz (18 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Collecting PyTweening>=1.0.1
Downloading PyTweening-1.0.3.zip (15 kB)
Collecting pyscreeze>=0.1.21
Downloading PyScreeze-0.1.26.tar.gz (23 kB)
Collecting pygetwindow>=0.0.5
Downloading PyGetWindow-0.0.9.tar.gz (9.7 kB)
Collecting mouseinfo
Downloading MouseInfo-0.1.3.tar.gz (10 kB)
Collecting pyrect
Downloading PyRect-0.1.4.tar.gz (15 kB)
Collecting pyperclip
Downloading pyperclip-1.8.1.tar.gz (20 kB)
Collecting idna<3,>=2.5
Downloading idna-2.10-py2.py3-none-any.whl (58 kB)
|████████████████████████████████| 58 kB 971 kB/s
Collecting urllib3<1.27,>=1.21.1
Downloading urllib3-1.26.3-py2.py3-none-any.whl (137 kB)
|████████████████████████████████| 137 kB ...
Collecting chardet<5,>=3.0.2
Downloading chardet-4.0.0-py2.py3-none-any.whl (178 kB)
|████████████████████████████████| 178 kB ...
Collecting certifi>=2017.4.17
Downloading certifi-2020.12.5-py2.py3-none-any.whl (147 kB)
|████████████████████████████████| 147 kB ...
Using legacy 'setup.py install' for pyautogui, since package 'wheel' is not installed.
Using legacy 'setup.py install' for pygetwindow, since package 'wheel' is not installed.
Using legacy 'setup.py install' for pyscreeze, since package 'wheel' is not installed.
Using legacy 'setup.py install' for PyTweening, since package 'wheel' is not installed.
Using legacy 'setup.py install' for mouseinfo, since package 'wheel' is not installed.
Using legacy 'setup.py install' for pyperclip, since package 'wheel' is not installed.
Using legacy 'setup.py install' for pyrect, since package 'wheel' is not installed.
Using legacy 'setup.py install' for wikipedia, since package 'wheel' is not installed.
Building wheels for collected packages: pymsgbox
Building wheel for pymsgbox (PEP 517) ... done
Created wheel for pymsgbox: filename=PyMsgBox-1.0.9-py3-none-any.whl size=7420 sha256=d59df53dfe5be4b27d802a0929f73cc03891d4fc4ccb794efb37c8c5e7e98357
Stored in directory: c:\users\rcf\appdata\local\pip\cache\wheels\7f\13\8c\584c519464297d9637f9cd29fd1dcdf55e2a2cab225c76a2db
Successfully built pymsgbox
Installing collected packages: urllib3, soupsieve, pyrect, pyperclip, idna, chardet, certifi, requests, PyTweening, pyscreeze, pymsgbox, pygetwindow, mouseinfo, beautifulsoup4, wikipedia, pyautogui, Pillow, p
ywhatkit
Running setup.py install for pyrect ... done
led.
Building wheels for collected packages: pymsgbox
Building wheel for pymsgbox (PEP 517) ... done
Created wheel for pymsgbox: filename=PyMsgBox-1.0.9-py3-none-any.whl size=7420 s
ha256=d59df53dfe5be4b27d802a0929f73cc03891d4fc4ccb794efb37c8c5e7e98357
Stored in directory: c:\users\rcf\appdata\local\pip\cache\wheels\7f\13\8c\584c51
9464297d9637f9cd29fd1dcdf55e2a2cab225c76a2db
Successfully built pymsgbox
Installing collected packages: urllib3, soupsieve, pyrect, pyperclip, idna, charde
t, certifi, requests, PyTweening, pyscreeze, pymsgbox, pygetwindow, mouseinfo, bea
utifulsoup4, wikipedia, pyautogui, Pillow, pywhatkit
Running setup.py install for pyrect ... done
Running setup.py install for pyperclip ... done
Running setup.py install for PyTweening ... done
Running setup.py install for pyscreeze ... done
Running setup.py install for pygetwindow ... done
Running setup.py install for mouseinfo ... done
Running setup.py install for wikipedia ... done
Running setup.py install for pyautogui ... done
Successfully installed Pillow-8.1.0 PyTweening-1.0.3 beautifulsoup4-4.9.3 certifi-
2020.12.5 chardet-4.0.0 idna-2.10 mouseinfo-0.1.3 pyautogui-0.9.52 pygetwindow-0.0
.9 pymsgbox-1.0.9 pyperclip-1.8.1 pyrect-0.1.4 pyscreeze-0.1.26 pywhatkit-3.9 requ
ests-2.25.1 soupsieve-2.1 urllib3-1.26.3 wikipedia-1.4.0
(venv) C:\Users\RCF\PycharmProjects\pywhatkitWhatsAppAutomate>
Running setup.py install for pyscreeze ... done
Running setup.py install for pygetwindow ... done
Running setup.py install for mouseinfo ... done
Running setup.py install for wikipedia ... done
Running setup.py install for pyautogui ... done
Successfully installed Pillow-8.1.0 PyTweening-1.0.3 beautifulsoup4-4.9.3 certifi-2020.12.5 chardet-4.0.0 idna-2.10 mouseinfo-0.1.3 pyautogui-0.9.52 pygetwindow-0.0.9 pymsgbox-1.0.9 pyperclip-1.8.1 pyrect-0.1
.4 pyscreeze-0.1.26 pywhatkit-3.9 requests-2.25.1 soupsieve-2.1 urllib3-1.26.3 wikipedia-1.4.0
IN PYTHON PAGE JUST RIGHT:
import pywhatkit
pywhatkit.sendwhatmsg("+916497980318","This is a message",11,56)
here 11=Hour
56=Minutes
therefore 11:56 Am
Conclusion:
So that's it. You can use this script to automate WhatsApp to send Birthday wishes to your friends and family, to send daily morning message to your parents or use it for some business idea
Comments
Post a Comment