Skip to content
This repository has been archived by the owner on May 8, 2020. It is now read-only.

Chrome Hangs #7

Closed
NoahCardoza opened this issue Sep 7, 2017 · 10 comments
Closed

Chrome Hangs #7

NoahCardoza opened this issue Sep 7, 2017 · 10 comments
Labels

Comments

@NoahCardoza
Copy link

NoahCardoza commented Sep 7, 2017

When I run the screenshot sample code it attempts to download Chrome. But after downloading it hangs.

[W:pyppeteer.chromium_downloader] start chromium download. Download may take a few minutes. [W:pyppeteer.chromium_downloader] chromium download done. [W:pyppeteer.chromium_downloader] chromium extracted to: /Users/<username>/.pyppeteer/local-chromium/497674

It does download the Chrome app. If I kill the script and retry, it won't download the app again but it doesn't do anything either.

This is the trace when I ^C

^CTraceback (most recent call last): File "test.py", line 13, in <module> browser = launch() File "/usr/local/lib/python3.6/site-packages/pyppeteer/launcher.py", line 117, in launch return Launcher(options, **kwargs).launch() File "/usr/local/lib/python3.6/site-packages/pyppeteer/launcher.py", line 84, in launch time.sleep(0.1) KeyboardInterrupt

Any ideas?

@miyakogi
Copy link
Owner

miyakogi commented Sep 7, 2017

Thank you for reporting.
Which OS are you using?

@NoahCardoza
Copy link
Author

OS X Seria

@miyakogi
Copy link
Owner

miyakogi commented Sep 7, 2017

Reproduced on my mac.
I'll check and try to fix it.

@miyakogi miyakogi added the bug label Sep 7, 2017
@NoahCardoza
Copy link
Author

Sweet, thanks!

@miyakogi
Copy link
Owner

miyakogi commented Sep 7, 2017

Maybe downloaded zip was broken when extracted by python.

Workaroud:

could you try this workaround?

@NoahCardoza
Copy link
Author

Yes, that seems to fix it.

Although now I get this error:

Traceback (most recent call last): File "test.py", line 9, in <module> asyncio.get_event_loop().run_until_complete(main(browser)) File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 467, in run_until_complete return future.result() File "test.py", line 7, in main await page.screenshot({'~/': 'example.png'}) File "/usr/local/lib/python3.6/site-packages/pyppeteer/page.py", line 511, in screenshot if mimeType == 'image/png': UnboundLocalError: local variable 'mimeType' referenced before assignment

@miyakogi
Copy link
Owner

miyakogi commented Sep 7, 2017

Keep 'path' as is.
If you want to save image in another directory, that line would become await page.screenshot({'path': '/path/to/example.png'}).

And the UnboundLocalError is fixed by #3.
If any problem still exist, try update pyppeteer to the latest dev versoin.

python3 -m pip install -U git+https://github.com/miyakogi/pyppeteer@dev

@NoahCardoza
Copy link
Author

NoahCardoza commented Sep 7, 2017

Ah I thought I was supposed to replace path with the path I wanted to save at.

Thanks for the help!

@miyakogi
Copy link
Owner

miyakogi commented Sep 7, 2017

😄

miyakogi added a commit that referenced this issue Sep 8, 2017
@alexcandrews
Copy link

alexcandrews commented Jul 12, 2018

Hate to bring this up again, experiencing the same issue. On the latest release of pyppeteer. Running the example downloads chromium and appears to unzip it just fine. However the script never makes it past launch(). Tried the fix suggested here with no luck. Also uninstalled pyppeteer and removed the .pyppeteer folder, no luck. Also tried installing a previous version of pyppeteer (0.0.17) but experienced the same.

Also on macOS High Sierra.

Thanks for any ideas!

###UPDATE
Saw #88 and have made the fix (I was working with 3.7). Thanks!

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

No branches or pull requests

3 participants