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

newPage() causes infinite await loop #459

Open
Ollenmire opened this issue Jan 4, 2024 · 5 comments
Open

newPage() causes infinite await loop #459

Ollenmire opened this issue Jan 4, 2024 · 5 comments

Comments

@Ollenmire
Copy link

I'm running the following code:

import asyncio
from pyppeteer import launch

# Get page

url = 'https://quotes.toscrape.com/'

async def main():
    browser = await launch(headless=False)
    page = await browser.newPage()
    await page.goto(url)
    await page.screenshot({"path": "example.png"})
    await browser.close()

asyncio.get_event_loop().run_until_complete(main())

When I run it I get a blank page and the program enters an infinite loop at the 'await browser.newPage()` line and never breaks out of he loop to get to the next line. I'm using the latest version of pyppeteer and I updated Chromium.

@mothguib
Copy link

mothguib commented Jan 5, 2024

Same issue.

@GabsMarcelino
Copy link

Also with me

@ramonmoraes
Copy link

@Ollenmire and @GabsMarcelino by using the

    browser = await launch({ 'headless': False, 'args': ['--no-sandbox']})

Fixed for me

Ref: #194 (comment)

@tenlisboa
Copy link

ramonmoraes

Great! I suppose it is the sandbox mode, if you just use the arg --no-sandbox would work.

@dgtlmoon
Copy link

this can also happen if the endpoint is unavailable (ie, not listening/closed/wrong address/wrong path etc)

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

6 participants