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

await page.content() stuck forever? #7395

Closed
ecolss opened this issue Jul 2, 2021 · 3 comments
Closed

await page.content() stuck forever? #7395

ecolss opened this issue Jul 2, 2021 · 3 comments

Comments

@ecolss
Copy link

ecolss commented Jul 2, 2021

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 10.1.0
  • Platform / OS version: macOS Big Sur, 11.4
  • URLs (if applicable): https://venturebeat.com/
  • Node.js version: v14.15.1

What steps will reproduce the problem?
Just copy and run the following code:

import pptr from "puppeteer";

async function main(args) {
    let browser = await pptr.launch({
        headless: false,
        defaultViewport: null,
    });

    const url = "https://venturebeat.com/";
    let page = await browser.newPage();
    page.on('console', consoleObj => console.log(consoleObj.text()));

    await page.goto(url, { waitUntil: "networkidle2", timeout: 10000 })
      .catch(err => console.log(`page.goto rejected, err: ${err}`)),
    console.log(`stop loading`);

    // NOTE: seems stuck here forever?
    let contentSize = (await page.content()).length;
    console.log(`content size = ${contentSize}`);

};

main();

What is the expected result?
Since page.goto would timeout, so .catch handles the error.
After that I expect page content size on console, i.e. reach and run the following line of code

console.log(`content size = ${contentSize}`)

What happens instead?
Never print anything, code stuck right at the await page.content(), forever.

@Poyoman39
Copy link

Seems linked to #4011

@stale
Copy link

stale bot commented Jun 23, 2022

We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm it yet. It will be closed if no further activity occurs within the next 30 days.

@stale stale bot added the unconfirmed label Jun 23, 2022
@stale
Copy link

stale bot commented Jul 23, 2022

We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accomodate it!

@stale stale bot closed this as completed Jul 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants