rudisulistyo / WhatsApp-bot-selenium

This is a simple Web WhatsApp Bot developed in python using Selenium. Helpfull to send messages to whatsapp contacts automatically using web.whatsapp.com and web automation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

# WhatsApp Bot

This is a simple Web WhatsApp Bot developed in python using Selenium. 
Selenium is used mainly for automating web applications for testing purposes, but is certainly not limited to just that. Boring web-based administration tasks can (and should!) be automated as well.

Selenium has the support of some of the largest browser vendors who have taken (or are taking) steps to make Selenium a native part of their browser. It is also the core technology in countless other browser automation tools, APIs and frameworks.

  - Send messages to family, friends and contacts automatically
  - Send specific message at specified time for all choosen contacts
  - Send the message in group also

# Features!

  - Send a specific message to a particular contact at any time of the day
  - One can send a single message to multiple contacts over a specific time
  - Multiple messages to multiple contacts
  - It offers a delay so that WhatsApp can detect your are sending a URL and show its pop-up description.
  - It can search a contact from the list if the contact isn't present in the recent chats
  - Save the contact name, number in a xls file and save it in the same directory.
  - Change the message along with time in the whatsapp.py
  - You can add multiple messages
  - The Script can also search for the contact in the new chat list and then send message if the contact is not found in the recent chat list.
  
### Requirements

* [Python 3+](https://www.python.org/download/releases/3.0/?) - Pyhton 3.6+ verion
* [Selenium](https://github.com/SeleniumHQ/selenium) - Selenium for web automation
* [openpyxl](https://pypi.org/project/openpyxl/) - To read xls files

### Installation

Step 1: Install Selenium 
```sh
$ pip3 install selenium
```

Step 2: Selenium requires a driver to interface with the chosen browser.
> For [Click for Chrome](https://sites.google.com/a/chromium.org/chromedriver/downloads)
> For [Click for FireFox](https://github.com/mozilla/geckodriver/releases)
> For [Click for safari](https://webkit.org/blog/6900/webdriver-support-in-safari-10)

Step 3: Extract the downloaded driver onto a folder

Step 4: Set path variable to the environment. Paste this command to the terminal
```sh
$ export PATH=$PATH:/home/path/to/the/driver/folder/
Eg: $ export PATH=$PATH:/home/harshit/Desktop/WhatsAppBot
```
Step 5: run whatsapp.py using Python3
```sh
$ python3 whatsapp.py
```
Step 6: When the browser is opened web.whatsapp.com will be opened and will ask to scan a QR code when you it first time

Step 7: After Scanning the QR code, you will be asked to press Enter Key in the terminal.

### Note

You can also add Names of the contact you want to send message in the Contacts.txt file.
The contact name should match exactly with the name saved in your contacts.

About

This is a simple Web WhatsApp Bot developed in python using Selenium. Helpfull to send messages to whatsapp contacts automatically using web.whatsapp.com and web automation.

License:MIT License


Languages

Language:Python 100.0%