Spamming WhatsApp Messages Using Python (pyautogui)



In this article, we will learn how to install pyautogui and we will spam WhatsApp messages using Python

So first of all, we have to install pyautogui on our PC so for that write the following command in your terminal

>>> pip install pyautogui


After installation, download the particular file called animal.txt from the following link Open Link after downloading the file put the file into the same folder for a better coding experience 

After installation, make a .py file on your PC 

Start Writing the Python code

Import sleep from the time module and pytautogui as pg
write the following code in your .py file

from time import sleep
import pyautogui as pg
sleep(10)
#full path of the animal .txt file
txt= open('E:\Collage Work\Programming\Python/animals.txt', 'r')
a = '(Your firend Name) is a '
for i in txt:
  sleep(1)
  pg.write(a+i)
  #to press enter button
  pg.press('Enter')


After saving the code we have to run this code, After saving this you have 10 seconds to open web WhatsApp on your chrome and open your friends chat and see the magic the following program will automatically send the messages to your friend

Thanks for reading the article, comment to suggest any improvement in my articles because I am still learning.

1 Comments

Previous Post Next Post