Command line interface of whatsapp web in the terminal (Unofficial).
This works with selenium-webdriver to login to whatsapp web interface and search the reciever name.
- Send and receive messages to and from any contact/group in your WhatsApp from command line.
- Switch between different chats from command line.
- Python 3 Tested with 3.4.3, 3.6.1. Python 2 will not work
- selenium Tested with 2.53.6, 3.4.2
- ChromeDriver Tested with 2.24, 2.29
- Chrome Web Browser compatible with the ChromeDriver version you downloaded. (Eg. ChromeDriver 2.29 supports Chrome v56-58) You can get this info from the ChromeDriver download page.
- Clone this repository.
$ git clone https://github.com/sspeedy/whatsapp-cli.git
- Install virtualenv
$ sudo pip3 install virtualenv
- Create the virtual environment
$ virtualenv whatsapp
- Activate the virtual environment
$ source whatsapp/bin/activate
- Install selenium.
$ sudo pip3 install selenium
- Download and extract ChromeDriver.zip
- Put path to ChromeDriver executable in the line
'chromedriver_path': '/path/to/chromedriver'
inchat.py
file of this repository.
In order to not reinvent the wheel, some of the stuff and generic ideas are taken from here.
WhatsApp Bot
$ python chat.py <name>
- Replace
<name>
with the name of a contact or a group in your WhatsApp. Even partial names will work. - Scan the QR code displayed on screen from the WhatsApp mobile app.
- Press
y
in console after WhatsApp Web is done loading, to connect your phone.
stopsending
- Type it while
chat.py
is running. - This will allow you to only see incoming messages. Your messages won't be sent. To send messages again, restart the script.
In chat.py
file:
config = {
'chromedriver_path': '/path/to/chromedriver',
'get_msg_interval': 5, # Time (seconds). Recommended value: 5
'colors': True, # True/False. True prints colorful msgs in console
...
}
Press Ctrl+C
two times.
To add Recent chats option.
Ability to see all the unread messages
Automate the activate using shell scripts