mirror of
https://github.com/metafy-social/python-scripts.git
synced 2025-01-18 07:17:03 +00:00
added whatsapp automation script
This commit is contained in:
parent
e7afb43995
commit
995d98d3af
21
scripts/whatsapp_automation/whatsapp-automation.py
Normal file
21
scripts/whatsapp_automation/whatsapp-automation.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
from selenium import webdriver
|
||||
import time
|
||||
|
||||
driver = webdriver.Chrome()
|
||||
driver.get('https://web.whatsapp.com/')
|
||||
|
||||
input('Scan the QR code and then press "enter"')
|
||||
name_of_recipient = input('To whom do you want to send the message:')
|
||||
msg = input('Enter your message:')
|
||||
|
||||
user = driver.find_element_by_xpath(f'//span[@title = "{name_of_recipient}"]')
|
||||
user.click()
|
||||
textbox = driver.find_element_by_class_name('_3uMse')
|
||||
|
||||
for i in range(200):
|
||||
textbox.send_keys(msg)
|
||||
send = driver.find_element_by_class_name('_1U1xa')
|
||||
send.click()
|
||||
time.sleep(5)
|
||||
|
||||
driver.quit()
|
Loading…
Reference in New Issue
Block a user