Python Whatsapp API based on Selenium and ChromeDriver
Working as of Jul 11 2020
Chrome
and ChromeRemote
work together to control the browser instance. Once
Chrome
has been started with start_chrome.py
, you can just start the remote
with start_remote.py
and it will use the same browser instance.
It saves a profile/session
file to save chrome.command_executor._url
and
chrome.session_id
.
See the ChromePy repo for more info on the remote aproach.
- All web.whatsapp.com limitations
- Scan QRCode on first run
- You must have a persons number saved to your phone
- You must set the contact exact and complete saved name
- Names must be unique in your contacts list
A screens/qrcode.png
file is saved for scaning with your smartphone.
WhatsPy will try to save a profile so you don't need to scan the qrcode everytime.
Keep in mind that whatsapp logs you out if you try to login in multiple browsers.
WhatsPy uses a Chrome class that is just a wraper Singleton for the Selenum default implementation adding a few easy to use enhancements.
To use chrome with selenium you will need ChromeDriver.
A profile
directory will be added to your project directory to save chrome profile.
- Save QRCode image for scan
- Send message to contact by name
- Read latest chats
- Read latest messages from chat
- Send message to contact by number
- Read latest archived chats
- Read latest archived messages from chat
- Archive chat
- Unarchive chat