title: Puppeteer Execution context was destroyed, most likely because of a navigation
body: <p>I am facing this problem in puppeteer in a for loop when i go on another page to get data, then when i go back it comes me this error line:</p>
  
  <pre><code>Error "We have an error Error: the execution context was destroyed, probably because of a navigation."
  </code></pre>
  
  <p>It's a directory page that contains 15 companies per page and then I want to visit each company to get information.</p>
  
  <pre><code>try {
      const browser = await pupputer.launch({
          headless: false,
          devtools: true,
          defaultViewport: {
              width: 1100,
              height: 1000
          }
      });
  
      const page = await browser.newPage();
      await page.goto('MyLink');
  
      await page.waitForSelector('.list-firms');
  
      for (var i = 1; i &lt; 10; i++) {
  
          const listeCompanies = await page.$$('.list-firms &gt; div.firm');
  
          for (const companie of listeCompanies) {
  
              const name = await companie.$eval('.listing-body &gt; h3 &gt; a', name =&gt; name.innerText);
              const link = await companie.$eval('.listing-body &gt; h3 &gt; a', link =&gt; link.href);
  
              await Promise.all([
                  page.waitForNavigation(),
                  page.goto(link),
                  page.waitForSelector('.firm-panel'),
              ]);
  
              const info = await page.$eval('#info', e =&gt; e.innerText);
  
              const data = [{
                  name: name,
                  information: info,
              }];
  
              await page.goBack();
  
          }
          await Promise.all([
              page.waitForNavigation(),
              page.click('span.page &gt; a[rel="next"]')
          ]);
      }
  } catch (e) {
      console.log('We have error', e);
  }
  </code></pre>
  
  <p>I managed to only get the data of the first company.</p>