Skip to main content

tithiwa - Web WhatsApp bot: Automate Web WhatsApp with selenium in python.

Project description

logo

tithiwa - Web WhatsApp bot

Automate Web WhatsApp with selenium.

Check Headless tithiwa challenge

Full explained Videos on that project are coming soon. Stay tune with our youtube channel Noobie Techs

Table of contents

Contribution and creativity points

Selenium automation creativity points

  1. Debugging Example
    We can create breakpoints to pause execution at any time then we can try to run some python code in the console to find a way to do something. That helps to develop efficiently.
  2. CTRL + Left mouse click Example
    We can see the definitions or references or usages of any function or variable in our IDE like PyCharm. That helps to understand the existing code base efficiently.
  3. Inspect elements and console Example
    In chrome, we can inspect HTML elements and run javascript code inside console. That helps up to find better selectors and automations steps efficiently.

NOTE: By pressing UP key we can see the history about what codes we had run during Python debugging and inside Chrome's console.
NOTE: If you are running javascript code inside selenium chromedriver's console then it will NOT keep history.
Good luck :)

Automation ideas

  • Todo: Clear chats of all groups
  • Todo: Clear chats of all contacts
  • Todo: Clear all chats both groups and contacts
  • Todo: Auto-reply given messages to some given messages
  • Todo: Scrap chat as text
  • Todo: Track online status of given number
  • Todo: Send given message to given contacts at some given time i.e schedule messages
  • Todo: Join group by invite link
  • Todo: Change Web WhatsApp's settings
  • Todo: Scape all contacts and send message containing URL to their own chatroom
  • Todo: Get currently opened Web WhatsApp's mobile number
  • Todo: Open chat to the same number as currently opened Web WhatsApp's number
  • Todo: Join multiple groups by invite links
  • Todo: Delete chats of all exited groups
  • Todo: Delete chats of all contacts
  • Todo: Get number from contact name
  • Todo: Get number of views to my status
  • Todo: Get my name
  • Todo: Get my about
from tithiwa import Tithiwa

# Create bot 
tithiwabot = Tithiwa()

## Generate sessions and open sessions ✔ 
tithiwabot.generate_session("filename")
tithiwabot.open_session("filename")

## Open chatroom and send message ✔ 
tithiwabot.open_chat_to("919592140593")
tithiwabot.open_chat_to_number_using_url("919592140593") # wa.me/919592140593
tithiwabot.send_message_to("919592140593", "Hello, from Tithiwa")

## Get number from contact name ✔ 
print(tithiwabot.get_mobile_number_of("Contact1"))

## Send a message to multiple chats ✔ 
tithiwabot.send_message_to_multiple_chats("hello", ["contact1", "contact2", "Group1"])

## Send a message to multiple chats at given time ✔ 
tithiwabot.send_message_at_time_to(["contact1", "contact2", "Group1"],
                                   "hi, from tithiwa at 9:36PM",
                                   "21:36:00")

## Create new WhatsApp group ✔ 
tithiwabot.create_group("GroupName", ["contact1", "contact2", "contact2"])

## Scrape members list from group ✔ 
print(tithiwabot.scrape_members_from_group("GroupName")) # ["contact1", "contact2", "contact2"]

## Make given contacts as group admins of given group ✔ 
tithiwabot.make_group_admins("GroupName", ["contact1", "contact2"])

## Remove given contacts from given group ✔ 
tithiwabot.remove_members_from_group("GroupName", ["contact1", "contact2"])

## Send a message to a group with mentioning all group members ✔ 
tithiwabot.send_message_with_mention_all_to_group("GroupName", "Hello All")

## Exit from group ✔
tithiwabot.exit_from_group("GroupName1")

## Exit from all groups ✔
tithiwabot.exit_from_all_groups()

## Exit from given groups ✔
tithiwabot.exit_from_groups(["GroupName1", "GroupName2"])

Installation

NOTE - pip contains older version i.e clone repo to use

pip install tithiwa

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tithiwa-0.1.30.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

tithiwa-0.1.30-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file tithiwa-0.1.30.tar.gz.

File metadata

  • Download URL: tithiwa-0.1.30.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.1

File hashes

Hashes for tithiwa-0.1.30.tar.gz
Algorithm Hash digest
SHA256 84fc17d0dfd362033f8dfb63cd5f6cae93048ff23513e264b9fd9ba18ddbbe03
MD5 1c82a989ae00f42891db1fe9b6058461
BLAKE2b-256 3a2819b4e3f92f1e47a68105c801c1b8f1573eff21cf39216257b8da8f295740

See more details on using hashes here.

File details

Details for the file tithiwa-0.1.30-py3-none-any.whl.

File metadata

  • Download URL: tithiwa-0.1.30-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.1

File hashes

Hashes for tithiwa-0.1.30-py3-none-any.whl
Algorithm Hash digest
SHA256 f6b6f2d6c090010c82505afc21fbc5fbe86cef35c239afe881d8ae7dcbc0b576
MD5 f5110a4b4dc0a5d31b7038d9301b4b94
BLAKE2b-256 1c515e84a90ebbdf7782610c3b81d8f6f5adcd55071948e7dbd2b61ee1a1fc4f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page