title: How to handle multiple redirection in puppeteer?
body: <p>I am trying to open a page after a form post inside evaluate. There are 2 redirections after form post which can be any number and then I find a final page.</p>
  
  <p>I tried to handled it by putting below (2 times for 2 redirections) after evaluate in which form post happened.</p>
  
  <pre><code>await page.waitForNavigation({'waitUntil':'domcontentloaded'});
  await page.waitForNavigation({'waitUntil':'domcontentloaded'});
  </code></pre>
  
  <p>The above worked properly but I have to handle the situations when any number of redirections can happen.</p>
  
  <p>I won't have any specific selector on DOM as page might be different many times.</p>
  
  <ul>
  <li>Puppeteer version: 1.4.0</li>
  <li>Platform / OS version: Linux</li>
  <li>URLs (if applicable): NA</li>
  <li>Node.js version: 8.10.0</li>
  </ul>
  
  <p>The below is part of code which I am using:</p>
  
  <pre><code>const formPost = await page.evaluate(a =&gt; {
  
      var form = formBuilder("payment_post", "post", acsUrl);                
      for (var i in a) {
          form.add(i, i, 'hidden', a[i]);
      }
      form.generate("pareqFormContainer");
      form.submit();
      return document.querySelector('#pareqFormContainer').innerHTML;
  
  }, jsonData)
  .then(function () {
      logger.info("form submitted with pareq and MD for txnId : " + jsonData.txnId)
  });               
  
  await page.waitForNavigation({'waitUntil' : 'domcontentloaded', 'timeout' : waitTimeOut}); 
  await page.waitForNavigation({'waitUntil' : 'domcontentloaded', 'timeout' : waitTimeOut});
  </code></pre>