evmer / perlego-downloader

Download books from Perlego.com in PDF format
MIT License
117 stars 54 forks source link

Error #60

Open dominicolivercort opened 1 year ago

dominicolivercort commented 1 year ago

Hello,

I'm getting this error after successful download of the chapter.

chapters 0-1 downloaded chapters 1-2 downloaded chapters 2-3 downloaded chapters 3-4 downloaded chapters 4-5 downloaded chapters 5-6 downloaded chapters 6-7 downloaded chapters 7-8 downloaded chapters 8-9 downloaded chapters 9-10 downloaded chapters 10-11 downloaded chapters 11-12 downloaded chapters 12-13 downloaded chapters 13-14 downloaded chapters 14-15 downloaded chapters 15-16 downloaded chapters 16-17 downloaded Traceback (most recent call last): File "/Users/DO/downloader.py", line 250, in asyncio.run(html2pdf()) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/Users/DO/downloader.py", line 171, in html2pdf browser = await launch(options={ ^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pyppeteer/launcher.py", line 307, in launch return await Launcher(options, **kwargs).launch() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pyppeteer/launcher.py", line 168, in launch self.browserWSEndpoint = get_ws_endpoint(self.url) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pyppeteer/launcher.py", line 227, in get_ws_endpoint raise BrowserError('Browser closed unexpectedly:\n') pyppeteer.errors.BrowserError: Browser closed unexpectedly:

Any ideas on how to fix this?

Thank you

ctechid commented 1 year ago

I resolved problem with add follows code

browser = await launch(options={
            'headless': True,
            'autoClose': False,         
                        `'executablePath': 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe',

in downloader.py

Look at result download in C:\Python311 folder