3281448091 / easyChatGPT

An unofficial yet elegant interface of the ChatGPT API using browser automation that bypasses cloudflare detection and recaptchas.
GNU General Public License v2.0
187 stars 24 forks source link

Error rasied when using headless mode #7

Open oxyhexagen opened 1 year ago

oxyhexagen commented 1 year ago

Hi, thanks for sharing this work. The script runs perfectly well in gui mode, but i tried it in headless mode as i want to deploy it on a centos server, following error occured:

Browser successfully launched, logging in to account...
Updated session
Updated session
Updated session
Traceback (most recent call last):
  File "D:\tools\gpttools\chatgpt_tools.py", line 15, in <module>
    chat = ChatClient(OPENAI_EMAIL, OPENAI_PASSWORD, headless=True)
  File "D:\ProgramData\Anaconda3\envs\chatgpt\lib\site-packages\easychatgpt\chatgpt.py", line 85, in __init__
    self.__login(username, password)
  File "D:\ProgramData\Anaconda3\envs\chatgpt\lib\site-packages\easychatgpt\chatgpt.py", line 105, in __login
    login_button.click()
AttributeError: 'list' object has no attribute 'click'

Process finished with exit code 1
3281448091 commented 1 year ago

headless does not work as it is detected by cloudflare

3281448091 commented 1 year ago

I am trying to make it work through virtual display.

DiTo97 commented 1 year ago

I am trying to make it work through virtual display.

Hi @LanLan69, check out this piece of code I put together two years ago to run the undetected Chrome driver on a Google Colab notebook via a virtual display.

I hope it will be helpful!