-
Notifications
You must be signed in to change notification settings - Fork 0
/
Wp_bot.py
21 lines (20 loc) · 1.22 KB
/
Wp_bot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
chats=['bot1','Paapa','Ma','bot2'] #give the contacts
driver = webdriver.Chrome(executable_path="/usr/local/lib/node_modules/chromedriver/bin/chromedriver",) #webdriver path
driver.get("https://web.whatsapp.com/")
driver.maximize_window()
print("Scan QR code ")
time.sleep(10)
for chat in chats :
driver.find_element_by_xpath("//*[contains(@class,'_3FRCZ copyable-text selectable-text')]").send_keys(f"{chat}")
driver.find_element_by_xpath("//*[contains(@class,'_3FRCZ copyable-text selectable-text')]").send_keys(Keys.ENTER)
time.sleep(4)
driver.find_element_by_xpath("//*[contains(@class,'_2FVVk _2UL8j')]").send_keys(" Helowwwww :D ")
driver.find_element_by_xpath("//*[contains(@class,'_2FVVk _2UL8j')]").send_keys(Keys.ENTER)
driver.find_element_by_xpath("//*[contains(@class,'_2FVVk _2UL8j')]").send_keys(Keys.ENTER)
time.sleep(4)
driver.find_element_by_xpath("//*[contains(@class,'_2FVVk _2UL8j')]").send_keys(" wtsuoppp :D ")
driver.find_element_by_xpath("//*[contains(@class,'_2FVVk _2UL8j')]").send_keys(Keys.ENTER)
driver.find_element_by_xpath("//*[contains(@class,'_2FVVk _2UL8j')]").send_keys(Keys.ENTER)