Skip to main content

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!

Generic badge Generic badge Generic badge Generic badge Generic badge Generic badge

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 😎

Maintenance GitHub Release CodeFactor

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 ...

wapp_driver_scrnsht

How to install ??

pip3 install wappdriver

PyPI

MIT LICENSE

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

made-with-python

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wappdriver-0.2.6.tar.gz (8.3 kB view hashes)

Uploaded Source

Built Distribution

wappdriver-0.2.6-py3-none-any.whl (8.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page