Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/y-agg/pywakit

Automate the sending process of the message in WhatsApp through selenium
https://github.com/y-agg/pywakit

automation pip python selenium selenium-webdriver whatsapp-bot whatsapp-web

Last synced: 3 months ago
JSON representation

Automate the sending process of the message in WhatsApp through selenium

Awesome Lists containing this project

README

        

[](https://medium.com/@yashaggarwal_/web-whatsapp-message-automation-through-python-613d48474dd7)

## About 📟
Do you ever wonder sending messages automatically by just running a simple python script? Yes, you heard it right, it can be done easily by using this package with selenium.
Selenium is a very smart package in python with which developers can automate the browser’s activity. With this, we can make use of Whatsapp-web through the browser and use it to automate message transfers.

## PYPI.org ⚗️
You can find [pywakit](https://pypi.org/project/pywakit/) command to install on your local system.

## Basic Requirement 📖
1. Library/Packages — Selenium , Chromedriver(for web automation).
2. IDE — Jupyter Notebook, Sublime, Visual Studio Code (It can even your command prompt, it just have to run Python).
3. Browser — Opensource Chromium web browser(FYI Google chromedriver is preffered).

## Pip And Use 📋
```
# You can easily start using this Library
# Run the following command in your command prompt
# Make use pip library is installed on your system.
# run the following command to ensure it
>> pip --version
# To install pywakit, run the following command
>> pip install pywakit
```

## Clone and use 📋
```
# You can also clone the repository by running the follwoing command
>> git clone https://github.com/y-agg/pywakit.git
```

## Get Started Code 🏃
```
# This will import WhatsApp class to send message
>> from pywakit import Whatsapp

# This will create the object of WhatsApp class
>> wa = Whatsapp()

# [Optional] If you slow internet connection, set
>> wa.retry= 20 #or anything higher then 10
# Default value of retry is 10

# This is for initial setup to run the program
# If You don't have Chromedriver in your system, call this function with no parameters.
# Function will automatically download The chrome Driver file based on sys config.
# This will properly work with google chrome and window user for now. In the future function, functionality will be fixed to work with all platforms.
# For the rest to the users, pass the chrome driver location as a parameter to the function.
# By any chance window use is facing problem for chrome driver downloading. Download it manually and pass the location of the file as a parameter.
>> wa.setup_driver()
# Alternative option
# CHROMEDRIVER _PATH is the path of chrome driver
>> wa.setup_driver(CHROMEDRIVER _PATH)

# This function is designed to QR code
>> wa.scan_code()

# This Function will send a message. It requires number(to whom the message is being sent) and the message(what should be sent?) as parameters.
# Both Should be of String type
>> wa.send_message(number,message)

# This will close of all the object and pointers. Its is for better practice.
>> wa.destroy()

# This Function will show all the log generated by the program.
>> wa.show_log()

# This function will print all the number to whom message is been sent till now.
>> wa.show_history()
```

## Technologies used 🛠️
1. [Python](https://www.python.org/)
2. [Selenium Library](https://www.selenium.dev/)

## Bugs? 🍥
“I think there’re some bugs on your code… !”. or maybe, “I think there’re some bugs on your code” Whatever the language is! You’re right, there are.

1. The program will crash. There is no such thing as perfect code. Some or other possibilities will found to cause program failure. But I do my best to keep this module bug be.
2. Feel free to fix, reuse, and duplicate this repository.
3. Any Problem? I’ve must have inserted something that will point to contact detail.

## LICENCE ✨
This project under the MIT License — see the [MIT License](https://github.com/y-agg/pywakit/blob/master/LICENSE) file for details.

## Connect 💡