Error: Execution context was destroyed, most likely because of a navigation.
See original GitHub issueTell us about your environment:
- Puppeteer version: 1.13.0
- Platform / OS version: OSX 10.14
- Node.js version: v9.10.0
const puppeteer = require('puppeteer');
const jsonReturn = [];
(async () => {
const browser = await puppeteer.launch({
headless: false,
devtools: true
});
const page = await browser.newPage();
await page.evaluate(() => {
debugger;
});
const response = await page.goto('https://myurl.com');
console.log('served from cache?', response.fromCache());
// debugger;
await page.waitForSelector('.featured-shows-featured-show');
const featuredShows = await page.$$('.featured-shows-featured-show');
for (const featuredShow of featuredShows) {
debugger;
const link = await featuredShow.$('a');
link.click();
await page.waitForSelector('.show-title');
debugger;
const showTitle = page.$('.show-title')
const showDates = page.$('.show-dates')
const showLocation = page.$('.show-location')
const showGallery = page.$('.entity-link')
const showDetail = page.$('.show-press-release')
jsonReturn.push({
showTitle,
showDates,
showLocation,
showGallery,
showDetail,
});
await page.goBack();
}
console.log(jsonReturn);
await browser.close();
})();
Getting Error:
UnhandledPromiseRejectionWarning: Error: Execution context was destroyed, most likely because of a navigation.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Puppeteer Execution context was destroyed, most likely ...
The error means that you are accessing data which has become obsolete/invalid because of navigation. In your script the error references the ...
Read more >Execution context was destroyed, most likely ... - GitHub
I am getting the same error using Puppeteer "version": "1.13.0". ERROR: Execution context was destroyed, most likely because of a navigation.
Read more >Puppeteer: "Execution context was destroyed, most likely ...
To fix the “execution context was destroyed, most likely because of a navigation” error, use the page.waitForNavigation() function: const ...
Read more >Execution context was destroyed, because of navigation
We are having a issue in Ultimate PDF when trying to generate a single PDF. Last week, It's working but unfortunately it doesn't...
Read more >playwright._impl._api_types.error: execution context was ...
To fix the “execution context was destroyed, most likely because of a navigation” error, use the page.waitForNavigation () function: The page.waitForNavigation ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am also facing same issue and working on same scenario. @stoplion Can you please share that how do you fixed this issue ?
Thanks in Advance 👍
I’m having a similar issue. I would like to cycle through a list then
goBack
click another link and cycle through that list as well. However, it is losing the handle when I navigate back.