Skip to content

Instantly share code, notes, and snippets.

@vishnu1991
Last active August 13, 2018 05:39
Show Gist options
  • Save vishnu1991/2938129e2ce6234e5d441612fc22adf4 to your computer and use it in GitHub Desktop.
Save vishnu1991/2938129e2ce6234e5d441612fc22adf4 to your computer and use it in GitHub Desktop.
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:
print(elem)
i = i + 1
#driver.find_element_by_class_name('compose-btn-send').click()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment