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
Page.Content freezes without error after running 101 times #4011
Comments
I can reproduce with this reduced code: 'use strict';
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const [page] = await browser.pages();
for (let i = 0; i < 200; i++) {
await page.goto('http://www.example.com/?page=' + i);
console.log('Before Page.content', i);
const html = await page.content();
console.log('After Page.Content', i);
await page.waitFor(500);
}
await browser.close();
})(); It stops at:
|
Have a similar issue with const puppeteer = require("puppeteer");
(async () => {
const browser = await puppeteer.launch();
const [page] = await browser.pages();
for (let i = 0; i < 200; i++) {
await page.goto("http://www.example.com/?page=" + i);
console.count("i");
try {
await page.waitForSelector("body");
} catch (error) {
const exists = await page.evaluate(() =>
Boolean(document.querySelector("body"))
);
console.log(error.name);
console.log("exists: " + exists);
}
await page.waitFor(500);
}
await browser.close();
})(); Seems like a logs
i: 94
executionContextCreated: frameId 8848BB97D31B30DE5B85C03C971953D6, type default
executionContextCreated: frameId 8848BB97D31B30DE5B85C03C971953D6, type isolated
i: 95
executionContextCreated: frameId 8848BB97D31B30DE5B85C03C971953D6, type default
executionContextCreated: frameId 8848BB97D31B30DE5B85C03C971953D6, type isolated
i: 96
executionContextCreated: frameId 8848BB97D31B30DE5B85C03C971953D6, type default
executionContextCreated: frameId 8848BB97D31B30DE5B85C03C971953D6, type isolated
i: 97
executionContextCreated: frameId 8848BB97D31B30DE5B85C03C971953D6, type default
executionContextCreated: frameId 8848BB97D31B30DE5B85C03C971953D6, type isolated
i: 98
executionContextCreated: frameId 8848BB97D31B30DE5B85C03C971953D6, type default
executionContextCreated: frameId 8848BB97D31B30DE5B85C03C971953D6, type isolated
i: 99
executionContextCreated: frameId 8848BB97D31B30DE5B85C03C971953D6, type default
executionContextCreated: frameId 8848BB97D31B30DE5B85C03C971953D6, type isolated
i: 100
executionContextCreated: frameId 8848BB97D31B30DE5B85C03C971953D6, type default
i: 101
TimeoutError
exists: true
executionContextCreated: frameId 8848BB97D31B30DE5B85C03C971953D6, type default
i: 102
TimeoutError
exists: true
executionContextCreated: frameId 8848BB97D31B30DE5B85C03C971953D6, type default
i: 103
TimeoutError
exists: true
executionContextCreated: frameId 8848BB97D31B30DE5B85C03C971953D6, type default
i: 104
TimeoutError
exists: true |
puppeteer@1.12.2 |
Did 1.11.0 help solve the issue? |
yeah, 1.11.0 works perfectly! |
puppeteer@1.7.0 has no freeze issue, too. |
Upstream fix has landed as https://chromium-review.googlesource.com/c/chromium/src/+/1496759; this'll be fixed after a roll. |
This roll includes: - https://crrev.com/636867 - devtools: bump max number of devtools isolated worlds Fix puppeteer#4011
This roll includes: - https://crrev.com/636867 - devtools: bump max number of devtools isolated worlds Fix #4011
Can confirm - downgrading to 1.11.0 solves freezing. (in my case caused by |
downgrading to 1.11.0 solves freezing |
So iv'e been experiencing the same issue for some time. Tried many different approaches but lately have been just changing document/top location property to switch pages. Just need to be careful if the page hasn't loaded yet if your queuing up another url coming through the pipe. await mGlobalPage.evaluate(function(url){ |
I'm having a similar issue - I'm using frame.content() to get the HTML content of iframes, and that call usually hangs. I reverted to 1.11.0 and it seems to work again. Unfortunately I can't provide good reproduction steps, because I encounter the problems when running on pages with 3rd party ads in iframes. |
@eric-zeng this should be working just fine on Puppeteer v1.14.0 |
This roll includes: - https://crrev.com/636867 - devtools: bump max number of devtools isolated worlds Fix puppeteer#4011
Updating to 1.14.0 solved my iframe issue, thanks! Somehow didn't notice the new release. |
@aslushnikov, I also encountered the same issue with v1.13.0 and v1.14.0 that waitforselector only works for 100 times. reverted to v1.11.0 worked as expected. |
I also get a timeout error on a ... await page.waitForSelector('div#contentDiv'); ... when looping over some sub pages. I recently upgraded to v.1.14.0 ... I think from v.1.11.0 where I did not have this issue. I went back to v.1.11.0 and it's working again. |
This still happens to me on HeadlessChrome/79.0.3945.79 with puppeteer-core 2.0.0. If I replace my await page.evaluate(() =>
Boolean(document.querySelector('...'))
); my code works as expected. Downgrading to 1.11.0 also works as expected. |
@pendo324 @vsemozhetbyt i'm trying to figure out how to pass variable to querySelector. I'm referencing to selector the following way:
no success. |
@Mahanchello Try this: await page.evaluate(selector =>
Boolean(document.querySelector(selector)),
sel.sub.confirmBtn
); |
@vsemozhetbyt helped, thanks 😄 |
@pendo324 solution on puppeteer-core v2 headless works great. |
Happening to me still with v2.0 |
Yes, it's happening to me still with v2.0 too |
@djErock : I am also facing the similar issue, it works fine for me in local machine, but when we run it as docker image i see timeout issues for page.waitforselector. Can you please help, if you were able to find some solution for it. Thanks |
how exactly did you solve it? can you show the code? |
We are also facing timeouts issues on jenkins, which is running on docker image. can you help us understand what worked for you? |
I downgraded to 0.11, I believe. Then replaced with playwrite I think. These issues brought back some early memories from Splinter. I also ensured we didn’t open tabs right and left. |
Previous version used to randomly hang while creating screenshots This issues shows that some old versions are subjective to random freezes puppeteer/puppeteer#4011 So upgrading to latest version should fix our issue This fixes #1842
I am still having this exact same issue as the original post. Running puppeteer 10.2.0? Any thoughts? |
Hello! Same here, puppeteer worked great for several iterations of going through a page, then after N loops it will hang at |
any thought about this? thanks! |
What steps will reproduce the problem?
Run the script and wait to i == 1129 (around 101 page visit) it would just freeze and hang
Please include code that reproduces the issue.
Link to Full Code : https://gist.github.com/rainbowhat/00ee308129fd52b87156b5e0715f8fff
What is the expected result?
It's expected to keep running until 10,000
What happens instead?
It freezes and no errors appear, The output during the freeze is
I have to do a ctrl + c to end the program.
The text was updated successfully, but these errors were encountered: