A Playwright-based WhatsApp client to interact with x-cortex.
Project description
x-whatsapp
x-whatsapp
by x-cortex is a python library for automating WhatsApp interactions. It uses playwright to automate tasks such as sending messages, fetching chat history, and listening for new messages on WhatsApp Web.
Usage
Initializing the Client
from x_whatsapp import WhatsappClient
# Initialize the client with debugging enabled
client = WhatsappClient(DEBUG=True)
# Initialize Playwright and launch the browser
await client.initialize_playwright()
# Log in to WhatsApp
await client.login()
Sending a Message
await client.send_message("contact_name", "Hello from x-whatsapp!")
Fetching Chat History
await client.open_chat_panel("contact_name")
messages = await client.extract_messages()
for message in messages:
print(message)
Logging Out
await client.logout()
Contributing
Contributions are welcome! Please fork the repository and submit a pull request for any enhancements or bug fixes.
License
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
x_whatsapp-0.1.0.tar.gz
(10.8 kB
view hashes)
Built Distribution
Close
Hashes for x_whatsapp-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32ffd7d897e1c9f6a22553b6a02244617281c59e9d221880a908d82ceeab6c93 |
|
MD5 | 3017eb9d6350ea2ee95093512860ff3e |
|
BLAKE2b-256 | 3542430dd2e6c57cf06418404ae4edcd852787b42dbba6680311b5ab0eaec2dc |