Send Automated Whatsapp Messages Using Python


from selenium import webdriver
try:
    driver = webdriver.Chrome()
    driver.get('https://web.whatsapp.com/')
    for x in range(1,10,1):
        

        name = input('Enter the name of user or group : ')
        #msg = input('Enter your message : ')
        msg=" Best Programming web site  http://msktutorials.com/   Click Here Learn More"
        count = int(input('Enter the count : '))

        input('Enter anything after scanning QR code')

        user = driver.find_element_by_xpath('//span[@title = "{}"]'.format(name))
        user.click()

        msg_box = driver.find_element_by_class_name('_2S1VP')

        for i in range(count):
            msg_box.send_keys(msg)
            button = driver.find_element_by_class_name('_35EW6')
            button.click()
except:
    pass