-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwhatspp.py
42 lines (29 loc) · 873 Bytes
/
whatspp.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
34
35
36
37
38
39
40
41
42
import datetime
import os
import bs4
import time
import requests
import pandas as pd
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
url="https://web.whatsapp.com/"
driver=webdriver.Chrome()
driver.get(url)
time.sleep(40)
#res=requests.get(url)
target="Siddarth Misha Iit Ism"
now=datetime.datetime.now()
h=int(now.strftime("%H"))
m=int(now.strftime("%M"))
timedelay=( ((22*60)+43)*60 - ((h*60)+m)*60 )
time.sleep(timedelay)
search=driver.find_element_by_xpath('//*[@id="side"]/div[1]/div/label/input')
search.send_keys(target)
search.send_keys(Keys.ENTER)
time.sleep(5)
textmsg=driver.find_element_by_xpath('//*[@id="main"]/footer/div[1]/div[2]/div/div[2]')
textmsg.send_keys(" HAPPY BIRTHDAY ")
textmsg.send_keys(Keys.ENTER)
time.delay(5)
driver.close()
os.system("shutdown /s /t 5")