Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

websockets.exceptions.ConnectionClosedOK: sent 1000 (OK); then received 1000 (OK) asyncio.exceptions.InvalidStateError: invalid state #474

Open
iamdaguduizhang opened this issue Apr 30, 2024 · 0 comments

Comments

@iamdaguduizhang
Copy link

Python 3.8.19
pyppeteer 1.0.2 2.0.0

场景:访问google时,出现验证码,处理完验证码后,抛出异常

异常堆栈:
connection unexpectedly closed
Task exception was never retrieved
future: <Task finished name='Task-960' coro=<Connection._async_send() done, defined at C:\ProgramData\Anaconda3\envs\lazbao_work\lib\site-packages\pyppeteer\connection.py:69> exception=InvalidStateError('invalid state')>
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\lazbao_work\lib\site-packages\pyppeteer\connection.py", line 73, in _async_send
await self.connection.send(msg)
File "C:\ProgramData\Anaconda3\envs\lazbao_work\lib\site-packages\websockets\legacy\protocol.py", line 635, in send
await self.ensure_open()
File "C:\ProgramData\Anaconda3\envs\lazbao_work\lib\site-packages\websockets\legacy\protocol.py", line 944, in ensure_open
raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedOK: sent 1000 (OK); then received 1000 (OK)

	During handling of the above exception, another exception occurred:

	Traceback (most recent call last):
	  File "C:\ProgramData\Anaconda3\envs\lazbao_work\lib\site-packages\pyppeteer\connection.py", line 79, in _async_send
	    await self.dispose()
	  File "C:\ProgramData\Anaconda3\envs\lazbao_work\lib\site-packages\pyppeteer\connection.py", line 170, in dispose
	    await self._on_close()
	  File "C:\ProgramData\Anaconda3\envs\lazbao_work\lib\site-packages\pyppeteer\connection.py", line 151, in _on_close
	    cb.set_exception(_rewriteError(
	asyncio.exceptions.InvalidStateError: invalid state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant