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)
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.0.tar.gz
(4.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.0-py3-none-any.whl
(4.9 kB
view details)
File details
Details for the file vjwhats-1.0.tar.gz.
File metadata
- Download URL: vjwhats-1.0.tar.gz
- Upload date:
- Size: 4.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 |
e55fba23e51fbc2a59fca89b16ee05a478f88efb76bb024f6bd1737491ce9f88
|
|
| MD5 |
71be528e5c8400d3e61516265fd69431
|
|
| BLAKE2b-256 |
9a1c7c7af70aaefc02263215f010100538fa38c07aa6e6ba440dec7b66ec155c
|
File details
Details for the file vjwhats-1.0-py3-none-any.whl.
File metadata
- Download URL: vjwhats-1.0-py3-none-any.whl
- Upload date:
- Size: 4.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 |
a1e7f7e0f4a70b0ab5f5d9850306dc06ae3739e1dd101b7dd5f240f0f360293e
|
|
| MD5 |
7773dfcb1f040445e4f05d6dddca3085
|
|
| BLAKE2b-256 |
c754440d2a18f021cce31edf6382fdbdc9805501e44cc738c7ca099f77a9a338
|