Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update server.py to work with chatgpt 3.5 UI #28

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def is_logged_in():

def is_loading_response() -> bool:
"""See if the send button is diabled, if it does, we're not loading"""
return not PAGE.query_selector("textarea ~ button").is_enabled()
return PAGE.query_selector('button div.text-2xl') != None

def send_message(message):
# Send the message
Expand All @@ -40,7 +40,7 @@ def get_last_message():
"""Get the latest message"""
while is_loading_response():
time.sleep(0.25)
page_elements = PAGE.query_selector_all("div[class*='request-:']")
page_elements = PAGE.query_selector_all(".markdown.prose")
last_element = page_elements.pop()
return last_element.inner_text()

Expand Down