title: Using Puppeteer to get a handle to the new page after "_blank" click?
body: <p>Looking at this simple code : </p>
  
  <pre><code>const browser = await puppeteer.launch({headless: false});
  const page: Page = await browser.newPage();
  await page.evaluate((a) =&gt;
                          {
  
                               //This will  open a new page :  
                              ([...document.querySelectorAll("a")][0] as HTMLElement).click();
                          });
  </code></pre>
  
  <p>If the clicked <code>A</code>(anchor) element has <code>target="_blank"</code> , then the page would be opened as a new page.</p>
  
  <p>It's not the original page object.</p>
  
  <p><strong>Question:</strong></p>
  
  <p>How can I get the new page object after a user has clicked on <code>&lt;a target="_blank"</code> ? </p>