Thus, I've decided to be adventurous and play around with little things which include making a digital clock, Email-Automation as well as automating my WhatsApp messages with python.
In this article, I'd be sharing with you guys how I've been able to automate my WhatsApp messages with just two lines of python code.
Por lo tanto, he decidido ser aventurero y jugar con peque帽as cosas que incluyen hacer un reloj digital, Automatizaci贸n de correo electr贸nico y automatizar mis mensajes de WhatsApp con python.
En este art铆culo, compartir茅 con ustedes c贸mo he podido automatizar mis mensajes de WhatsApp con solo dos l铆neas de c贸digo python.
WHATSAPP AUTOMATION

Automating your WhatsApp with python gives you the room to target your desired contact and a specific message you want them to receive as well as the time in which the message should be sent to them.
However, automating your WhatsApp with an external app most times would require a message from the group or contact itself upfront before sending a specified message to them and this isn't the contact targeted, for it sends the message to any group or contact that gives the required message.
So without further ado, let's get right into the tools needed for making WhatsApp automation via python code.
Tools for WhatsApp automation
- A laptop
- Installation of python if you haven't
- A code editor (preferably an IDE)
- Python module (Pywhatkit)
- An Internet connection
- A web browser (chrome, firefox, brave e.t.c..)
- And of course a WhatsApp account
La automatizaci贸n de su WhatsApp con python le brinda la posibilidad de dirigirse a su contacto deseado y un mensaje espec铆fico que desea que reciban, as铆 como el momento en que se les debe enviar el mensaje.
Sin embargo, automatizar su WhatsApp con una aplicaci贸n externa la mayor铆a de las veces requerir铆a un mensaje del grupo o un contacto por adelantado antes de enviarles un mensaje espec铆fico y este no es el contacto objetivo, ya que env铆a el mensaje a cualquier grupo o contacto que da el mensaje requerido.
Entonces, sin m谩s pre谩mbulos, entremos directamente en las herramientas necesarias para hacer la automatizaci贸n de WhatsApp a trav茅s del c贸digo python.
Herramientas para la automatizaci贸n de WhatsApp
- Un ordenador port谩til
- Instalaci贸n de python si no lo has hecho
- Un editor de c贸digo (preferiblemente un IDE)
- M贸dulo Python (Pywhatkit)
- Una conexi贸n a Internet
- Un navegador web (Chrome, Firefox, Brave, etc.)
- Y por supuesto una cuenta de WhatsApp
STEPS TO AUTOMATE

- Download a text editor. I prefer using pycharm in executing my python codes because it's one of the best IDEs for running python code.
Open your pycharm or your preferred editor and create a python project
- Descarga un editor de texto. Prefiero usar pycharm para ejecutar mis c贸digos python porque es uno de los mejores IDE para ejecutar c贸digo python.
Abra su pycharm o su editor preferido y cree un proyecto de python
After creating your project, you get a working space to write your python code.
- The next step is to install the module that allows us to make use of WhatsApp automation.
Pywhatkit is one of the beautiful libraries with several features on python that allows us to automate our WhatsApp with just a few codes.
Thus, to install Pywhatkit ensure that your machine is connected to the internet. Go to Google and type "Pywhatkit" in the search box.
Despu茅s de crear su proyecto, obtiene un espacio de trabajo para escribir su c贸digo python.
- El siguiente paso es instalar el m贸dulo que nos permite hacer uso de la automatizaci贸n de WhatsApp.
Pywhatkit es una de las hermosas bibliotecas con varias funciones en python que nos permite automatizar nuestro WhatsApp con solo unos pocos c贸digos.
Por lo tanto, para instalar Pywhatkit, aseg煤rese de que su m谩quina est茅 conectada a Internet. Vaya a Google y escriba "Pywhatkit" en el cuadro de b煤squeda.
- Go back to your working space on your code editor and navigate to your terminal. paste the copied text to the terminal and click on Enter.
- Regrese a su espacio de trabajo en su editor de c贸digo y navegue a su terminal. pegue el texto copiado en la terminal y haga clic en Entrar.
You then get a successfully installed message which stipulates that our WhatsApp automation module is fully ready to be imported.
However, you may encounter a few bugs while trying to install your pywhatkit, here are a few tips you might wanna try to fix the installation errors;
Use "pip install pipwin" if this doesn't work too, try "pipwin install pywhatkit" if this doesn't work too then try "pip install pywhatkit --upgrade"
If any of the methods above still doesn't work, then you might wanna try upgrading your python.
However, if you were able to download the module successfully but feel adventurous trying to figure out where the module is being located on your machine, follow the steps in the image below.
Luego recibe un mensaje de instalaci贸n exitosa que estipula que nuestro m贸dulo de automatizaci贸n de WhatsApp est谩 completamente listo para ser importado.
Sin embargo, es posible que encuentre algunos errores al intentar instalar su pywhatkit, aqu铆 hay algunos consejos que puede intentar corregir los errores de instalaci贸n;
Use "pip install pipwin" si esto tampoco funciona, intente "pipwin install pywhatkit" si esto tampoco funciona, intente "pip install pywhatkit --upgrade"
Si alguno de los m茅todos anteriores a煤n no funciona, es posible que desee intentar actualizar su python.
Sin embargo, si pudo descargar el m贸dulo con 茅xito pero se siente aventurero tratando de averiguar d贸nde se encuentra el m贸dulo en su m谩quina, siga los pasos en la imagen a continuaci贸n.
- The next step is to import the installed module to start the automation as shown below.
You import the module by typing "import pywhatkit" and then press Enter key to move to the next line.
You then type the code below to initiate the WhatsApp automation. Note that this is case sensitive which means your modules have to be typed in lower case.
pywhatkit.sendwhatsmsg("phone number", "message to be sent", hour, minutes)
Ensure your country code is well-typed before adding the phone number for there might be an error regarding the country code.
Also, the hour and minutes indicate the time in which you want the message to be sent to the receiver
In my own WhatsApp automation, I chose to send my message to my favourite hive mentor @starstrings01 for those of you who know him.
After you must have written the code correctly, go ahead and run the program.
- El siguiente paso es importar el m贸dulo instalado para iniciar la automatizaci贸n como se muestra a continuaci贸n.
Importa el m贸dulo escribiendo "importar pywhatkit" y luego presiona la tecla Intro para pasar a la siguiente l铆nea.
Luego escriba el c贸digo a continuaci贸n para iniciar la automatizaci贸n de WhatsApp. Tenga en cuenta que esto distingue entre may煤sculas y min煤sculas, lo que significa que sus m贸dulos deben escribirse en min煤sculas.
pywhatkit.sendwhatsmsg("n煤mero de tel茅fono", "mensaje a enviar", hora, minutos)
Aseg煤rese de que el c贸digo de su pa铆s est茅 bien escrito antes de agregar el n煤mero de tel茅fono, ya que podr铆a haber un error con respecto al c贸digo de pa铆s.
Adem谩s, la hora y los minutos indican la hora en la que desea que se env铆e el mensaje al receptor.
En mi propia automatizaci贸n de WhatsApp, eleg铆 enviar mi mensaje a mi mentor de colmena favorito @starstrings01 para aquellos de ustedes que lo conocen.
Despu茅s de haber escrito el c贸digo correctamente, contin煤e y ejecute el programa.
IF YOU'VE GOT VALUE FROM THIS POST, KINDLY GIVE YOUR LOVELY COMMENTS. ALSO, UPVOTES AND REBLOGS WOULD BE MUCH APPRICIATED.
THANKS FOR READING 馃ぉ馃ぉ
SI USTED TIENE VALOR DE ESTA PUBLICACI脫N, POR FAVOR DAR SUS ENCANTADORES COMENTARIOS. TAMBI脡N, LOS UPVOTES Y REBLOGS SER脥AN MUY AGRADECIDOS.
GRACIAS POR LEER 馃ぉ馃ぉ