mache102 / SlymeGPT

FREE GPT "API" (OpenAI GPT API replication with Selenium and Undetectable Chromedriver). Minimal setup
GNU General Public License v3.0
56 stars 9 forks source link

Unable to locate element #1

Open KeyLoggerDresioO opened 1 year ago

KeyLoggerDresioO commented 1 year ago

Hello, I have a problem. After running the script using "python .\open_browser.py", I receive the following message. How can I fix this?

Error: Traceback (most recent call last): File "c:\Users\Administrator\Desktop\ChatGPT-projekty\SlymeGPT\example.py", line 33, in <module> main() File "c:\Users\Administrator\Desktop\ChatGPT-projekty\SlymeGPT\example.py", line 9, in main slyme.select_latest_chat() File "c:\Users\Administrator\Desktop\ChatGPT-projekty\SlymeGPT\slyme.py", line 35, in wrapper raise e ^^^^^^^ File "c:\Users\Administrator\Desktop\ChatGPT-projekty\SlymeGPT\slyme.py", line 22, in wrapper return func(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\Administrator\Desktop\ChatGPT-projekty\SlymeGPT\slyme.py", line 179, in select_latest_chat chat_element = self.driver.find_element(By.CSS_SELECTOR, self.config.get('css', 'chat_elements')) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\Desktop\ChatGPT-projekty\.venv\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 831, in find_element return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\Desktop\ChatGPT-projekty\.venv\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 440, in execute self.error_handler.check_response(response) File "C:\Users\Administrator\Desktop\ChatGPT-projekty\.venv\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 245, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"li.relative[data-projection-id]"} (Session info: chrome=113.0.5672.93)

mache102 commented 1 year ago

Hello, can you try running open_browser.py again? What does it display? If you're already logged into ChatGPT, then AFAIK the only actions that can cause the issue are either starting the driver in headless mode or minimizing the browser window before it is automatically performed