title: Playwright error (Target closed) after navigation
body: <p>I'm trying something really simple:</p>
  
  <ul>
  <li>Navigate to google.com</li>
  <li>Fill the search box with "cheese"</li>
  <li>Press enter on the search box</li>
  <li>Print the text for the title of the first result</li>
  </ul>
  
  <p>So simple, but I can't get it to work. This is the code:</p>
  
  <pre class="lang-js prettyprint-override"><code>const playwright = require('playwright');
  
  (async () =&gt; {
    for (const browserType of ['chromium', 'firefox', 'webkit']) {
      const browser = await playwright[browserType].launch();
      try {
        const context = await browser.newContext();
        const page = await context.newPage();
        await page.goto('https://google.com');
        await page.fill('input[name=q]', 'cheese');
        await page.press('input[name=q]', 'Enter');
        await page.waitForNavigation();
  
        page.waitForSelector('div#rso h3')
            .then(firstResult =&gt; console.log(`${browserType}: ${firstResult.textContent()}`))
            .catch(error =&gt; console.error(`Waiting for result: ${error}`));
      } catch(error) {
        console.error(`Trying to run test on ${browserType}: ${error}`);
      } finally {
        await browser.close();
      }
    }
  })();
  </code></pre>
  
  <p>At first I tried to get the first result with a <code>page.$()</code> but it didn't work. After investigating the issue a little bit I discovered that <code>page.waitForNavigation()</code> that I thought would be the solution, but it isn't.</p>
  
  <p>I'm using the latest playwright version: 1.0.2.</p>