-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwhatsapp.py
32 lines (27 loc) · 1.11 KB
/
whatsapp.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
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
import time
from utils import *
from sendtext import *
class Whatsapp:
def __init__(self,to,content):
# self.driver = webdriver.Chrome(executable_path="C:/webdrivers/chromedriver")
self.driver = webdriver.Chrome(ChromeDriverManager().install())
self.to = to
self.content = content
def msg(self):
self.driver.get(url="https://web.whatsapp.com")
# search = self.driver.find_element_by_xpath("//*[@id='tsf']/div[2]/div[1]/div[1]/div/div[2]/input")
# search.click()
speak("Please scan the QR code for Whatsapp Web to operate.")
time.sleep(15)
inst = sendText(self,self.to,self.content)
return inst
# bot = Whatsapp
# man = bot("You","Thanks").msg()
# print(man)