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 test_wappdriver 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.7.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wappdriver-0.2.7-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file wappdriver-0.2.7.tar.gz.

File metadata

  • Download URL: wappdriver-0.2.7.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for wappdriver-0.2.7.tar.gz
Algorithm Hash digest
SHA256 ea3cb4d100a6b0fae3bcb4139dde61394d06c5b69e117ace870ee7b9ef2a1417
MD5 8778c61debeba080a3a871c487046cf6
BLAKE2b-256 7ab4913a27130cccf5145f55417b906093ee4641a3eceefdb0cc996082cca8d5

See more details on using hashes here.

File details

Details for the file wappdriver-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: wappdriver-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for wappdriver-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 17c6242b013d9d5e5b74a19c0f740688298cbba34baaf414c18569ee235d6615
MD5 d701737a9269df4ddf34d88b39c98519
BLAKE2b-256 0d44cf0c93c58abc5fa7e75030191177989bc80a067a4afad22ead637db272a4

See more details on using hashes here.

Supported by

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