Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Chrome tab is staying open #31

Open
ShadowTimGit opened this issue Dec 14, 2022 · 7 comments
Open

Chrome tab is staying open #31

ShadowTimGit opened this issue Dec 14, 2022 · 7 comments
Labels
enhancement New feature or request

Comments

@ShadowTimGit
Copy link

Was working pretty well for a while, but started to get an error with it only taking one message before saying i was sending too many requests per hour as an error. Realized there was a new version available and assuming it was just openai patching a previous use, so updated to latest version, and now it seems to work fine but the chrome browser tab ChatGPT(TOKEN) uses is staying open on my screen instead of running in the background. Is this new behavior intentional?

@terry3041 terry3041 added enhancement New feature or request question Further information is requested labels Dec 15, 2022
@terry3041
Copy link
Owner

terry3041 commented Dec 15, 2022

Well for now its intended because headless environment does not support minimizing the browser window.
So I have to keep compatibility. And its my exam period right now. I dont have the time to maintain this atm.

@terry3041 terry3041 removed the question Further information is requested label Dec 22, 2022
@mancunian1792
Copy link

You can get the driver object and close it yourself in your use case.

ChatGPT_object_instance.driver.close() should do it.

@kimkimkeren
Copy link

Well, somehow here I get error when closing the window

PS D:\openai-twitter-bot> python.exe script.py
Exception ignored in: <function ChatGPT.__del__ at 0x0000026F1896FDC0>
Traceback (most recent call last):
  File "C:\Users\Lukmanul Hakim\AppData\Local\Programs\Python\Python38\lib\site-packages\pyChatGPT\pyChatGPT.py", line 94, in __del__
  File "C:\Users\Lukmanul Hakim\AppData\Local\Programs\Python\Python38\lib\site-packages\undetected_chromedriver\__init__.py", line 721, in quit
AttributeError: 'NoneType' object has no attribute 'debug'
PS D:\openai-twitter-bot>

I guess it's related to importing error on chromedriver library part

@terry3041
Copy link
Owner

AttributeError: 'NoneType' object has no attribute 'debug'

Did you quit the driver manually (i.e. driver.quit())?
You don't need to do that in newer version.

@kimkimkeren
Copy link

kimkimkeren commented Dec 29, 2022

Did you quit the driver manually (i.e. driver.quit())? You don't need to do that in newer version.

No I don't, the traceback said the error comes from pychatgpt code

EDIT : it looks like I used the old function, when I use ChatGPT(auth_type, email, password, login_cookies_path) the error dissappears

@kimkimkeren
Copy link

kimkimkeren commented Jan 20, 2023

After a few days, I saw the window didn't quit automatically after executing the script. After seeing the main library, I use __del__ function and it seems work

@terry3041
Copy link
Owner

After a few days, I saw the window didn't quit automatically after executing the script. After seeing the main library, I use __del__ function and it seems work

Can you please try the latest version. It should quit the browser automatically now. Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants