Priyanshu-hawk / ChatGPT-unofficial-api-selenium

This is unofficial ChatGPT API totally written by me in python with selenium
MIT License
35 stars 10 forks source link

AttributeError: 'bool' object has no attribute 'click' #10

Open dankarthik25 opened 1 month ago

dankarthik25 commented 1 month ago

I am using LinuxMint
I had to reinstall my chrome because selenium session is not supported after when i run python api_backend.py
It is showing me error

06/14/2024 05:51:28 PM - ERROR: # Element '//*[contains(text(), 'Log in with your OpenAI account to continue')]' is not present.
Already logged in
06/14/2024 05:51:50 PM - ERROR: # Element '//*[contains(text(), 'Tips for getting started')]' is not present.
06/14/2024 05:51:50 PM - ERROR: # Element '//*[contains(text(), 'Tips for getting started')]' is not present.
No guidlines found
Enter text: hi how are you doing
06/14/2024 05:52:27 PM - ERROR: # Element '//*[@data-testid='send-button']' is not present.
06/14/2024 05:52:27 PM - ERROR: # Element '//*[@data-testid='send-button']' is not found.
Traceback (most recent call last):
  File "/media/karthik/myVolume/Project_Python/ChatGPT-unofficial-api-selenium/api_backend.py", line 127, in <module>
    resp = make_gpt_request(req)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/media/karthik/myVolume/Project_Python/ChatGPT-unofficial-api-selenium/api_backend.py", line 94, in make_gpt_request
    send_btn.click()
    ^^^^^^^^^^^^^^
AttributeError: 'bool' object has no attribute 'click' 
Priyanshu-hawk commented 1 month ago

Hello @dankarthik25 , i will update the code soon. Since ChatGPT UI has been updated so element's xpath is changed so the code is not able to locate correct button or element