mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-11-23 20:11:07 +00:00
Added Python Script HacktoberFest 2019 (#128)
* Added whatsapp-message Script * Update README.md
This commit is contained in:
parent
c04764c6d7
commit
ff0ca3a022
|
@ -76,6 +76,7 @@ So far, the following projects have been integrated to this repo:
|
||||||
|[PyRecorder](./PyRecorder)|[Rocky Jain](https://github.com/jainrocky)|
|
|[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)|
|
|[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)|
|
|[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)|
|
|[YTS Torrents](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/yts_torrents)|[Mayank Nader](https://github.com/makkoncept)|
|
||||||
|
|
||||||
## How to use :
|
## How to use :
|
||||||
|
|
21
send_whatsapp_message/README.md
Normal file
21
send_whatsapp_message/README.md
Normal file
|
@ -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.
|
1
send_whatsapp_message/Requirements.txt
Normal file
1
send_whatsapp_message/Requirements.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
selenium
|
20
send_whatsapp_message/whatsapp-message.py
Normal file
20
send_whatsapp_message/whatsapp-message.py
Normal file
|
@ -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.")
|
Loading…
Reference in New Issue
Block a user