diff --git a/README.md b/README.md index c954342..9cb305a 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ So far, the following projects have been integrated to this repo: |[PyRecorder](./PyRecorder)|[Rocky Jain](https://github.com/jainrocky)| |[Pretty CSV](https://github.com/Frizz925/Awesome-Python-Scripts/tree/pretty-csv/Pretty-CSV)|[Frizz925](https://github.com/Frizz925)| |[File Organizer](https://github.com/Frizz925/Awesome-Python-Scripts/tree/File-Organizer)|[Ayush Bhardwaj](https://github.com/hastagAB)| +|[send_whatsapp_message](https://github.com/mukeshprasad/Awesome-Python-Scripts/tree/master/send_whatsapp_message)|[Mukesh Prasad](https://github.com/mukeshprasad)| |[YTS Torrents](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/yts_torrents)|[Mayank Nader](https://github.com/makkoncept)| ## How to use : diff --git a/send_whatsapp_message/README.md b/send_whatsapp_message/README.md new file mode 100644 index 0000000..0ae1fe8 --- /dev/null +++ b/send_whatsapp_message/README.md @@ -0,0 +1,21 @@ +# Send Whatsapp message! + +One can easily send a whatsapp message using this script. +**Pre-requisite:** Scan QR code manually. + + +## Requirements + +- Python3 +- Selenium +```console +$ pip install -U selenium +``` +- Chromedriver (Needs to be in PATH) + +## Instructions + +- Install selenium of python module in a recognized location on your desktop. +- Install chromedriver from here. [https://chromedriver.chromium.org/downloads] + +**NOTE :** The version of Google Chrome and chromedriver has to be same. diff --git a/send_whatsapp_message/Requirements.txt b/send_whatsapp_message/Requirements.txt new file mode 100644 index 0000000..954f0db --- /dev/null +++ b/send_whatsapp_message/Requirements.txt @@ -0,0 +1 @@ +selenium \ No newline at end of file diff --git a/send_whatsapp_message/whatsapp-message.py b/send_whatsapp_message/whatsapp-message.py new file mode 100644 index 0000000..33b614a --- /dev/null +++ b/send_whatsapp_message/whatsapp-message.py @@ -0,0 +1,20 @@ +from selenium import webdriver + +driver = webdriver.Chrome() +driver.get('https://web.whatsapp.com/') +a=1 +while a!=0: + input('Scan QR code first and hit enter') + name = input('Enter the name of user or group : ') + msg = input('Enter your message : ') + count = int(input('Enter the count : ')) + user = driver.find_element_by_xpath('//span[@title = "{}"]'.format(name)) + user.click() + msg_box = driver.find_element_by_class_name('_3u328') + for i in range(count): + msg_box.send_keys(msg) + button = driver.find_element_by_class_name('_3M-N-') + button.click() + a=int(input("Wanna text any other guy?(0/1):")) +if a==0: + print("Bye!\nSee you soon.")