-
Notifications
You must be signed in to change notification settings - Fork 2
/
app.py
33 lines (26 loc) · 867 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# -*- coding: utf-8 -*-
'''
Created on Jul 6, 2016
@author: indrajit.n
'''
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
#driver = webdriver.Firefox()
driver = webdriver.Chrome()
driver.get("http://web.whatsapp.com/")
time.sleep(25)
newChat = driver.find_element_by_xpath('//*[@id="side"]/header/div[2]/div/span/div[2]/button')
newChat.click()
find = driver.find_element_by_xpath('//input[@title="Search contacts"]')
find.send_keys('Contact name')
time.sleep(3)
elem = driver.find_element_by_xpath('//span[contains(text(),"Contact name")]')
elem.click()
time.sleep(5)
elem1 = driver.find_element_by_xpath('//div[@class="pluggable-input-body copyable-text selectable-text"]')
i = 1
while True:
elem1.send_keys('pruuuuu+ ' + str(i))
i = i + 1
driver.find_element_by_class_name('compose-btn-send').click()