send msg update

now write_message write the msg, send_message click on the button to send it
This commit is contained in:
Crizomb 2023-04-08 19:46:21 +02:00 committed by GitHub
parent cb26c8b1bc
commit 37829003e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -78,16 +78,17 @@ class GPTDriver:
chat = soup.find_all("div", class_="""group w-full text-gray-800 dark:text-gray-100 border-b border-black/10 dark:border-gray-900/50 bg-gray-50 dark:bg-[#444654]""")[-1]
return chat
def send_message(self, txt):
def write_message(self, txt):
textarea = self.driver.find_element(By.XPATH, '//*[@id="__next"]/div[2]/div[2]/main/div[2]/form/div/div[2]/textarea')
better_send_keys(textarea, txt)
time.sleep(1)
def send_message(self):
button_send = self.driver.find_element(By.XPATH, '//*[@id="__next"]/div[2]/div[2]/main/div[2]/form/div/div[2]/button')
button_send.click()
def add_run_button(self):
#html of a big red button with border-radius of 10%, green background and white text pady by 10px up and padx by 10px left
button_html = '<button id="continueButton" style="position: fixed; bottom: 10px; right: 10px; font-size: 2em; background-color: green; color: white; border-radius: 10%;">Continue</button>'
button_html = '<button id="continueButton" style="position: fixed; bottom: 10px; right: 10px; font-size: 2em; background-color: green; color: white; border-radius: 10%;">Run code</button>'
xpath = """//*[@id="__next"]/div[2]/div[2]/main/div[2]/div/span"""
# Find the element using the given XPath