Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update3 not working any more #16

Open
tomcontr opened this issue Mar 22, 2020 · 3 comments
Open

update3 not working any more #16

tomcontr opened this issue Mar 22, 2020 · 3 comments

Comments

@tomcontr
Copy link

Hi,
Great work!

Do you have an updated version? Update3 seems not to work anymore...

REgards!

@tomcontr
Copy link
Author

tomcontr commented Mar 22, 2020

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()

@hkarthik97
Copy link

hkarthik97 commented Mar 30, 2020

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

@heykush
Copy link

heykush commented May 18, 2020

check in my repositroies i made a updated version and its fully working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants