title: How to set a interval with Puppeteer to run a certain amount of time?
body: <p>I would like to set an interval, so the code updates every second, but only for 2 minutes.</p>
  <p>I am not sure how to set this up.</p>
  <pre><code>const puppeteer = require('puppeteer');
  (async () =&gt; {
      let game = 'https://lichess.org/hj4DgCNN9BKG';
      let browser = await puppeteer.launch({ headless: false });
      let page = await browser.newPage();
      await page.goto(game, { waitUntil: 'networkidle2' });
      let data = await page.evaluate(() =&gt; {
      let time = document.querySelector('div[class=&quot;time&quot;]').innerText;
          return {                time
          };
      });
          console.log(data);
  })();
  </code></pre>