Skip to content
New issue

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

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

Already on GitHub? # to your account

page_elements = PAGE.query_selector_all(".flex.flex-col.items-center > div") changed #79

Open
MeinDeutschkurs opened this issue May 20, 2023 · 1 comment

Comments

@MeinDeutschkurs
Copy link

Yes it changed, but I'm not able to figure the correct one out, so currently I reload "new chat", and I take

page_elements = PAGE.query_selector_all(".flex.flex-col.items-start > div")

instead, with last_element = page_elements[0] instead of -2.

@MeinDeutschkurs
Copy link
Author

MeinDeutschkurs commented May 21, 2023

Ok, GOT it. This works (same chat history)

page_elements = PAGE.query_selector_all("div.group.w-full")
last_element = page_elements[-1]
return last_element.inner_text()

I reload the browser window every time before injecting the prompt. This avoids error 500 after two hours.

def send_message(message):
# Send the message
# Refresh the page before sending the message
time.sleep(2)
PAGE.reload()
# Wait for 5 seconds - because of longer history
time.sleep(5)
# Send the message
box = get_input_box()
box.click()

This was referenced May 29, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant