-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchatbox.py
More file actions
23 lines (22 loc) · 861 Bytes
/
chatbox.py
File metadata and controls
23 lines (22 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from selenium.webdriver.common.keys import Keys
from settings import driver
import time
#reply in chatbox(not working)
def chatbox():
try:
time.sleep(30)
driver.find_element_by_xpath('//button[@aria-label="Users and messages toggle"]').send_keys(Keys.RETURN)
time.sleep(5)
print("ok")
# driver.find_element_by_xpath('//div[@data-test="chatButton"]').send_keys(Keys.RETURN)
# driver.find_element_by_xpath('//div[@aria-label="Public Chat"]').send_keys(Keys.RETURN)
# time.sleep(5)
# reply = driver.find_element_by_xpath('//textarea[@placeholder="Send message to Public Chat"]')
# sendtext = "done"
# reply.send_keys(sendtext)
# reply.send_keys(Keys.ENTER)
# print("Written in Chatbox")
except:
print("Error sending message")
pass
return