Closed xdSora closed 1 year ago
hi, any work around for this issue?
I haven't done it myself, but I think if you get a simple example to work using pyperclip as standalone code, it should be an easy fix. I modified the code to use the built in shortcut for copying the last reply (Ctrl+shift+c), which also shows a popup message that the text was copied, so running it it with headless=False, I was able to see and confirm this function working. The issue lies somewhere in the process of pasting the response, can't comment further.
Yeah it seems like the issue generally happens when headless
parameter is set as true
. Switching from headless=True
to headless=False
and add a small timeout seems to fix the issue for me.
For me implementing a delay was not helping, but I did find another workaround for the issue.
I added this code at the very beginning of the send_message function:
self.driver.find_element(By.TAG_NAME, "body").send_keys(Keys.LEFT_CONTROL, "r")
Essentially right before sending a message, I reload the website, which fixes the issue where the chatbot would not write an answer even though the text is sent to it (it does answer, but it only shows up some time afterwards when you refresh the page)
I'm not sure what causes this originally, but will close the issue.
When running the following simple example, the output will be what the user last copy pasted instead of what chatgpt's reply was.
Steps to Reproduce
Additional
Installed xclip for pyperclip. The conversation is created and a reply is given, just not copied properly.