diff --git a/pyproject.toml b/pyproject.toml index 4f452f3..7a4bf53 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pyChatGPT" -version = "0.3.9.5" +version = "0.3.9.6" authors = [ { name="terry3041", email="s71czbem@duck.com" }, ] diff --git a/src/pyChatGPT/pyChatGPT.py b/src/pyChatGPT/pyChatGPT.py index c2c43d9..1b3364b 100644 --- a/src/pyChatGPT/pyChatGPT.py +++ b/src/pyChatGPT/pyChatGPT.py @@ -597,6 +597,9 @@ def send_message(self, message: str) -> dict: # Wait for the response to be ready self.__verbose_print('[send_msg] Waiting for completion') + WebDriverWait(self.driver, 5).until( + EC.presence_of_element_located((By.CLASS_NAME, 'result-streaming')) + ) WebDriverWait(self.driver, 120).until_not( EC.presence_of_element_located((By.CLASS_NAME, 'result-streaming')) ) @@ -604,7 +607,7 @@ def send_message(self, message: str) -> dict: # Get the response element self.__verbose_print('[send_msg] Finding response element') response = self.driver.find_elements( - By.XPATH, '//div[@class="flex-1 overflow-hidden"]//div[p]' + By.XPATH, '//div[starts-with(@class, "markdown prose w-full break-words")]' )[-1] # Check if the response is an error