A Python library to interact with WhatsApp Web using Selenium.
Project description
WhatsApp Library
A Python library to interact with WhatsApp Web using Selenium. Created by Fioruci, used mainly by VJ Bots.
Installation
Install the required packages using pip:
pip install selenium
Usage Example
from vjwhats import WhatsApp
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from pathlib import Path
def main():
# Configures of the current folder of Chrome/User Data and the desired profile directory
chrome_options = Options()
chrome_options.add_argument("user-data-dir=C:/Users/EXAMPLE/AppData/Local/Google/Chrome/User Data")
chrome_options.add_argument("profile-directory=Default") # It should be the same user as the connected to the WhatsApp Web
# Creating the WebDriver with Options
driver = webdriver.Chrome(options=chrome_options)
# Creating WhatsApp Instance
wpp = WhatsApp(driver)
# Sending a message to Contact 1
wpp.find_by_username("Contact 1")
wpp.send_message("Hello, this is a test message!")
# Sending a file to Contact 2
wpp.find_by_username("Contact 2")
wpp.send_file(Path("path/to/file"), which=1)
# Sending a file to a new Conversation
wpp.start_conversation("+55999977885")
wpp.send_file(Path("path/to/file"), which=1)
if __name__ == "__main__":
main()
Licence
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vjwhats-1.1.tar.gz
(5.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
vjwhats-1.1-py3-none-any.whl
(5.9 kB
view details)
File details
Details for the file vjwhats-1.1.tar.gz.
File metadata
- Download URL: vjwhats-1.1.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64f21e361e1dda5b50ace37567cb08f0200116370aa21cf6b6981c9655e867a0
|
|
| MD5 |
bf5f8ea1b220ca1123da50b591af8234
|
|
| BLAKE2b-256 |
b0ed6d6a55b0633040cbaa3579d7072f1d07f33bf184a08760f1f100c0199890
|
File details
Details for the file vjwhats-1.1-py3-none-any.whl.
File metadata
- Download URL: vjwhats-1.1-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9af0bb30358665ad32b6cfb31ce0392246c4903c0a51e767b2dacca62ceb35a6
|
|
| MD5 |
ffe1b5f889e7544a757d3b01efaa7703
|
|
| BLAKE2b-256 |
d6345228bcd99492cf912fdc1040b896015bc74a4980b2f3a5ef577c3bea2d7d
|