from selenium import webdriver
import Config
import time
#driver=webdriver.Firefox()
#driver.get("http.google.com")
driver=webdriver.Chrome(Config.chromedriver)
driver.get("https://web.whatsapp.com/")
name="Name" #your contact name
text="Hi..Good Morning ????"
input("Enter anything after scan")
count = int(input('Enter the count : '))
user = driver.find_element_by_xpath('//span[@title = "{}"]'.format(name))
user.click()
user = driver.find_element_by_xpath('//span[@title = "{}"]'.format(name))
user.click()
msg_box = driver.find_element_by_class_name('_2bXVy')
time.sleep(2)
for i in range(count):
msg_box.send_keys(text)
driver.find_element_by_class_name('_2lkdt').click()
It'll send WhatsApp message automatically.
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.