This Python script is designed to automate responses on WhatsApp based on received messages. It uses PyAutoGUI for GUI automation, Selenium for web scraping, and Pyperclip for clipboard operations.
- Python 3.x
- PyAutoGUI
- Pyperclip
- Selenium
- Chrome WebDriver
-
Install Python from python.org.
-
Install required Python packages:
-
Download Chrome WebDriver from ChromeDriver - WebDriver for Chrome and ensure it's in your system PATH or provide the path to it in the script.
- Ensure that Google Chrome is installed and logged into WhatsApp Web.
- Run the script.
- Keep WhatsApp Web open and wait for messages.
- Messages containing specific patterns will trigger automated responses. Currently supported patterns are for canceling or refilling orders.
- The script will process incoming messages, extract relevant information, and perform actions accordingly.
- Update the paths to image files used for locating elements on the screen (e.g., "smiley.png", "circle.png") if needed.
- Set up the path to the existing user data directory of Google Chrome for Selenium WebDriver (
user-data-dirargument inchrome_options).
- Ensure that Chrome WebDriver is compatible with the version of Chrome installed on your system.
- Adjust the confidence levels in PyAutoGUI's
locateOnScreenfunction calls as needed to accurately locate elements on the screen. - Make sure that your system is set up to handle the interactions and that the script operates correctly before leaving it unattended.
- Handle exceptions and errors gracefully to prevent unexpected behavior.
- This script was developed by [Abdul Hannan].