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.1.tar.gz
(10.9 kB
view hashes)
Built Distribution
Close
Hashes for x_whatsapp-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f4fed8533a74e30204747e8148b4a582d91dc861a0763f52eed7d2112a3b968 |
|
MD5 | 09955cf300651070499c19eeccec0617 |
|
BLAKE2b-256 | f9cef0bcbf781ec66cb3a6e70a1eac23f3ed37ae87f40ce3dff73306008de048 |