easyChatGPT icon indicating copy to clipboard operation
easyChatGPT copied to clipboard

Error rasied when using headless mode

Open oxyhexagen opened this issue 2 years ago • 3 comments

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

oxyhexagen avatar Dec 26 '22 15:12 oxyhexagen

headless does not work as it is detected by cloudflare

3281448091 avatar Dec 26 '22 17:12 3281448091

I am trying to make it work through virtual display.

3281448091 avatar Dec 26 '22 23:12 3281448091

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!

DiTo97 avatar Jan 04 '23 18:01 DiTo97