title: How would puppeteer wait for all redirects
body: <p>I have a puppeteer project which needs to submit a form and then wait for the next page. The problem is that to get to the next page, the site would make around 3-4 redirects and only then will start loading the actual content.</p>
  
  <p>It seems Puppeteer is getting stuck somewhere in the middle.</p>
  
  <p>How would I go around this?</p>
  
  <p>This is my code:</p>
  
  <pre><code>await page.goto('&lt;url&gt;/Login.html', {'waitUntil': 'networkidle0', timeout: 60000});
  
  await page.click(USERID_SLCT);
  await page.keyboard.type(creds.userId);
  await page.click(PWD_SLCT);
  await page.keyboard.type(creds.pwd);
  await page.click(LOGINBTN_SLCT);
  
  await page.waitForNavigation({'waitUntil': 'networkidle0'});
  
  await timeout(240000); // wait for the redirects to be finished
  
  await page.waitForSelector(BTN_SLCT, {timeout: 240000}); // make sure the page is loaded &lt;-- would fail here
  
  await page.screenshot({path: './screenshots/mainpage.png'});
  </code></pre>