title: How to get Puppeteer waitForNavigation Working after click
body: <p>I am trying to get puppeteer to wait for the navigation to finish before moving on to the next statement. Based on the <a href="https://github.com/GoogleChrome/puppeteer/blob/v1.7.0/docs/api.md#pagewaitfornavigationoptions" rel="noreferrer">Docs</a> for waitForNavigation() , the code should work below. but it just skips to the next statement and I have to use a workaround to wait for a specific URL in the response.</p>
  
  <p>I have tried all the waituntil options as well<br/>
   ( load, domcontentloaded, networkidle0 and networkidle2 ) .  </p>
  
  <p>Any ideas how I could get that working properly is appreciated.</p>
  
  <pre><code>const browser = await puppeteer.launch({
    headless: false,
  })
  const page = await browser.newPage()
  const home = page.waitForNavigation()
  await page.goto(loginUrl)
  await home
  
  const login = page.waitForNavigation()
  await page.type('#email', config.get('login'))
  await page.type('#password', config.get('password'))
  await page.click('#submitButton')
  await login // &lt;&lt; skips over this
  
  // the following line is my workaround and it works , but ideally I don't want 
  // to specify the expected "after" page each time I navigate
  await page.waitForResponse(request =&gt; request.url() === 'http://example.com/expectedurl')
  </code></pre>