Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

list index out of range #45

Closed
doevent opened this issue Dec 18, 2022 · 4 comments
Closed

list index out of range #45

doevent opened this issue Dec 18, 2022 · 4 comments

Comments

@doevent
Copy link

doevent commented Dec 18, 2022

Error: list index out of range

Version: 0.3.9.4


File "pyChatGPT.py", line 395, in send_message
    response = self.driver.find_elements(
IndexError: list index out of range
@872226263
Copy link

same problem, i post my soultion in #46

@scaryama
Copy link

My solve is modify 'pyChatGPT.py' file
"//div[starts-with(@Class, 'markdown prose break-words')]"

"//div[starts-with(@Class, 'markdown prose w-full break-words')]"

@terry3041
Copy link
Owner

Should be fixed in v0.3.9.5.

@p-i-
Copy link

p-i- commented Dec 22, 2022

(macOS)
Seems there's still an issue in 3.9.5.

resp = api.send_message('Hello, ChatGPT')

... gives:

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
Cell In[4], line 1
----> 1 resp = api.send_message('Hello, ChatGPT')

File ~/code/2023/ML/hacking-chatGPT/.venv/lib/python3.11/site-packages/pyChatGPT/pyChatGPT.py:562, in ChatGPT.send_message(self, message)
    560 # Get the response element
    561 self.__verbose_print('[send_msg] Finding response element')
--> 562 response = self.driver.find_elements(By.XPATH, '//div[@class="flex-1 overflow-hidden"]//div[p]')[-1]
    564 # Check if the response is an error
    565 self.__verbose_print('[send_msg] Checking if response is an error')

IndexError: list index out of range

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants