drunkdream / weread-exporter

将微信读书中的书籍导出成epub、pdf、mobi等格式
1.16k stars 180 forks source link

报错 #25

Open lj1998008 opened 1 year ago

lj1998008 commented 1 year ago

90b32020813ab7914g019ab7 这个运行到第三篇的时候,卡住不动了 [2023-05-19 14:31:37,263][ERROR][Exporter] Go to chapter 第三篇 * failed Traceback (most recent call last): File "C:\Users\2020\Desktop\1-exporter-main_exporter\export.py", line 303, in export_markdown await self._page.goto_chapter( File "C:\Users\2020\Desktop\1-exporter-main_exporter\webpage.py", line 390, in goto_chapter await self._page.goto(self._url, timeout=1000 * timeout) File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\pyppeteer\page.py", line 837, in goto raise error pyppeteer.errors.TimeoutError: Navigation Timeout Exceeded: 30000 ms exceeded. [2023-05-19 14:31:37,266][INFO][***WebPage] Go to chapter 13 [2023-05-19 14:31:37,267][ERROR]connection unexpectedly closed [2023-05-19 14:31:37,268][ERROR]Task exception was never retrieved future: <Task finished name='Task-2264' coro=<Connection._async_send() done, defined at C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\pyppeteer\connection.py:69> exception=InvalidStateError('invalid state')> Traceback (most recent call last): File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\protocol.py", line 968, in transfer_data message = await self.read_message() File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\protocol.py", line 1038, in read_message frame = await self.read_data_frame(max_size=self.max_size) File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\protocol.py", line 1113, in read_data_frame frame = await self.read_frame(max_size) File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\protocol.py", line 1170, in read_frame frame = await Frame.read( File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\framing.py", line 69, in read data = await reader(2) File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\asyncio\streams.py", line 706, in readexactly raise exceptions.IncompleteReadError(incomplete, n) asyncio.exceptions.IncompleteReadError: 0 bytes read on a total of 2 expected bytes

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\pyppeteer\connection.py", line 73, in _async_send await self.connection.send(msg) File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\protocol.py", line 635, in send await self.ensure_open() File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\protocol.py", line 944, in ensure_open raise self.connection_closed_exc() websockets.exceptions.ConnectionClosedError: sent 1000 (OK); no close frame received

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\pyppeteer\connection.py", line 79, in _async_send await self.dispose() File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\pyppeteer\connection.py", line 170, in dispose await self._on_close() File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\pyppeteer\connection.py", line 151, in _on_close cb.set_exception(_rewriteError( asyncio.exceptions.InvalidStateError: invalid state

卡住了

drunkdream commented 1 year ago

https://github.com/drunkdream/weread-exporter/blob/main/weread_exporter/webpage.py#L231

试下把这里的超时时间改成60或者更长试下呢,并确认下报错的时候页面上的头像图标是否展示出来了呢

lj1998008 commented 1 year ago

有时会遇到运行后跳出来来无数个浏览器

lj1998008 commented 1 year ago

7e432620813ab7a02g010361 这个完成后少了最后3个知识点的内容

90b32020813ab7914g019ab7 这个运行到第三篇的时候,卡住不动了 [2023-05-19 14:31:37,263][ERROR][Exporter] Go to chapter 第三篇 * failed Traceback (most recent call last): File "C:\Users\2020\Desktop\1-exporter-main_exporter\export.py", line 303, in export_markdown await self._page.goto_chapter( File "C:\Users\2020\Desktop\1-exporter-main_exporter\webpage.py", line 390, in goto_chapter await self._page.goto(self._url, timeout=1000 * timeout) File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\pyppeteer\page.py", line 837, in goto raise error pyppeteer.errors.TimeoutError: Navigation Timeout Exceeded: 30000 ms exceeded. [2023-05-19 14:31:37,266][INFO][***WebPage] Go to chapter 13 [2023-05-19 14:31:37,267][ERROR]connection unexpectedly closed [2023-05-19 14:31:37,268][ERROR]Task exception was never retrieved future: <Task finished name='Task-2264' coro=<Connection._async_send() done, defined at C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\pyppeteer\connection.py:69> exception=InvalidStateError('invalid state')> Traceback (most recent call last): File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\protocol.py", line 968, in transfer_data message = await self.read_message() File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\protocol.py", line 1038, in read_message frame = await self.read_data_frame(max_size=self.max_size) File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\protocol.py", line 1113, in read_data_frame frame = await self.read_frame(max_size) File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\protocol.py", line 1170, in read_frame frame = await Frame.read( File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\framing.py", line 69, in read data = await reader(2) File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\asyncio\streams.py", line 706, in readexactly raise exceptions.IncompleteReadError(incomplete, n) asyncio.exceptions.IncompleteReadError: 0 bytes read on a total of 2 expected bytes

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\pyppeteer\connection.py", line 73, in _async_send await self.connection.send(msg) File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\protocol.py", line 635, in send await self.ensure_open() File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\websockets\legacy\protocol.py", line 944, in ensure_open raise self.connection_closed_exc() websockets.exceptions.ConnectionClosedError: sent 1000 (OK); no close frame received

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\pyppeteer\connection.py", line 79, in _async_send await self.dispose() File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\pyppeteer\connection.py", line 170, in dispose await self._on_close() File "C:\Users\2020\AppData\Local\Programs\Python\Python310\lib\site-packages\pyppeteer\connection.py", line 151, in _on_close cb.set_exception(_rewriteError( asyncio.exceptions.InvalidStateError: invalid state

卡住了

drunkdream commented 1 year ago

试下通过--load-timeout=300参数来看下有没有效果

lj1998008 commented 1 year ago

感谢 我试试