Closed maodoutech closed 3 months ago
Hey,
thanks, I will look into this and get back to you.
I've updated the python script just now - could you please try again?
I've added a more robust message fetching logic and also added some debug statements, which, if it still doesn't work on your end, should help us pinpoint the issue :)
Traceback (most recent call last): File "/Users/luban/code/tool/ChatGPT-without-login/python/gpt.py", line 70, in
asyncio.run(main())
File "/usr/local/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 685, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/Users/luban/code/tool/ChatGPT-without-login/python/gpt.py", line 59, in main
await session.start()
File "/Users/luban/code/tool/ChatGPT-without-login/python/gpt.py", line 16, in start
await self.page.goto('https://chat.openai.com', waitUntil='networkidle0')
File "/Users/luban/code/tool/ChatGPT-without-login/python/venv/lib/python3.12/site-packages/pyppeteer/page.py", line 832, in goto
raise PageError(result)
pyppeteer.errors.PageError: net::ERR_CONNECTION_RESET at https://chat.openai.com
Exception ignored in atexit callback: <function Launcher.launch.._close_process at 0x10e14bf60>
Traceback (most recent call last):
File "/Users/luban/code/tool/ChatGPT-without-login/python/venv/lib/python3.12/site-packages/pyppeteer/launcher.py", line 153, in _close_process
self._loop.run_until_complete(self.killChrome())
File "/usr/local/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 660, in run_until_complete
self._check_closed()
File "/usr/local/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 540, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
sys:1: RuntimeWarning: coroutine 'Launcher.killChrome' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback