A package that automates sending messages through WhatsApp Web
Project description
API for WhatsApp Web Automation
Wondering how to send WhatsApp messages using Python using only few lines of code? You have come to the right place!
wappdriver
enables you to send WhatsApp messages programmatically, using only 3 lines of code.
A python package that helps you automate sending messages through WhatsApp Web 😎
It's very simple to use
import wappdriver as wa
bot = wa.WappDriver()
bot.send_message(to='aahnik',msg='Hi ! sent by a bot :-p ')
# the recipients name must be saved in your contacts ...
How to install ??
pip3 install wappdriver
WARNING ⚠️
WhatsApp does not allow you to login into the same account from multiple chrome tabs. So make sure to close any chrome tab which has WhatsApp Web open, before executing the following line when your session cookies(data for automatic login, without requiring you to scan QR code multiple times) are saved in your current directory.
bot = wa.WappDriver()
Not doing so may lead to errors or the program may hang.
You will be required to scan the QR Code for the first time only, thereafter the data saved within the wappDefaultSession
sub-directory will be used for automatic login. You can delete this folder to delete all cookies.
Requirements
Make sure to have matching versions of Chrome Browser and Chrome Driver. I recommend to use the latest version of both, for the best performance
Tests
Tests are very important for any application. Jacob Kaplan-Moss said "Code without tests is broken by design". And this statement can't be more true.
So we have multiple tests to check whether this application is working as expected. But these tests need certain user input to run such as names of people saved in your WhatsApp contacts. ( To avoid spamming, this application allows sending messages only to your WhatsApp contacts ).
These tests could not be automatically run on server via Travis CI or GitHub Actions due to certain constraints due to the nature of WhatsApp and this application. Know Why ?
I run the tests on a regular basis and manually update the feature badges at the top of this README, to indicate whether that particular feature is successfully working or not.
If you find that any of the features is not working as expected, feel free to create an issue. Nonetheless, you could easily clone this repo and run the tests locally after configuring the variables in testConfig.yml
file inside tests
directory. To learn how to run tests click here.
Want to contribute ?
Please look at Code of Conduct and Contributing Guidelines
Special Thanks to @VISWESWARAN1998
I learned a lot from his repo and had initially started working on it. In future, due to certain requirements, I created a seperate repo, with a different working all together.
Help
For help you can email me at meet.aahnik@gmail.com or chat on Telegram.You can expect a reply within 48 hours.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for wappdriver-0.2.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bff5bdf5a92f658a73931a23666e7472e8c87c9c669afe7edc690f2f8de8c1d8 |
|
MD5 | c3cf388702d85cb477c819cec49cf555 |
|
BLAKE2b-256 | e2b8fdc77e91b37ccb92d9f981a7b940f4e94f2c27236c9b079403e8c4219eda |