Youtube
Youtube copied to clipboard
update3 not working any more
trafficstars
Hi, Great work!
Do you have an updated version? Update3 seems not to work anymore...
REgards!
Fixed... this one works.
import os
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
import time
from selenium.webdriver.common.keys import Keys
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
DRIVER_BIN = os.path.join(PROJECT_ROOT, "chromedriver")
driver = webdriver.Chrome(executable_path = DRIVER_BIN)
#driver=webdriver.Chrome()
driver.get('https://web.whatsapp.com/')
wait = WebDriverWait(driver, 600)
name=input('Enter the name of contact or group you want to text: ')
text=input('Enter the text you want to send: ')
n=int(input('Enter the number of times you want the text to be sent: '))
input('Make sure you have scanned the QR code of whatsapp web. After that, press any key')
user = driver.find_element_by_xpath('//*[@id="side"]/div[1]/div/label/div/div[2]'.format(name))
user.send_keys(name)
time.sleep(2);
user.send_keys(Keys.RETURN);
text_box = driver.find_element_by_xpath('//*[@id="main"]/footer/div[1]/div[2]/div/div[2]')
for i in range(n):
text_box.send_keys(text)
butn = '_3M-N-'
button=wait.until(EC.presence_of_element_located((By.CLASS_NAME,butn)))
button.click()
Fixed... this one works.
import os from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By import time from selenium.webdriver.common.keys import Keys PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__)) DRIVER_BIN = os.path.join(PROJECT_ROOT, "chromedriver") driver = webdriver.Chrome(executable_path = DRIVER_BIN) #driver=webdriver.Chrome() driver.get('https://web.whatsapp.com/') wait = WebDriverWait(driver, 600) name=input('Enter the name of contact or group you want to text: ') text=input('Enter the text you want to send: ') n=int(input('Enter the number of times you want the text to be sent: ')) input('Make sure you have scanned the QR code of whatsapp web. After that, press any key') user = driver.find_element_by_xpath('//*[@id="side"]/div[1]/div/label/div/div[2]'.format(name)) user.send_keys(name) time.sleep(2); user.send_keys(Keys.RETURN); text_box = driver.find_element_by_xpath('//*[@id="main"]/footer/div[1]/div[2]/div/div[2]') for i in range(n): text_box.send_keys(text) butn = '_3M-N-' button=wait.until(EC.presence_of_element_located((By.CLASS_NAME,butn))) button.click()
Hi the above code doesnt work for me it types the message in my search bar
check in my repositroies i made a updated version and its fully working