title: Puppeteer can't find elements when Headless TRUE
body: <p>I'm facing some problems with Puppeteer, I want to extract a list of items and succeed when headless is FALSE but not when TRUE.</p>
  <p>First thing first, I want to get those elements before mapping on it.</p>
  <p>Here's my script, maybe you can reproduce it, it is really basic.</p>
  <hr />
  <pre><code>const chalk = require(&quot;chalk&quot;);
  
  const baseUrl = &quot;https://www.interencheres.com/recherche/lots?search=&quot;;
  
  const searchTerm = &quot;Apple&quot;;
  
  const searchUrl = baseUrl + searchTerm;
  
  (async () =&gt; {
    const browser = await puppeteer.launch({
      headless: false,
      ignoreHTTPSErrors: true,
      args: [`--window-size=1920,1080`],
      defaultViewport: {
        width: 1920,
        height: 1080,
      },
    });
  
    const page = await browser.newPage();
  
    // Begin navigation
    console.log(chalk.yellow(&quot;Beginning navigation.&quot;));
    await page.goto(searchUrl);
  
    // Await List of elements;
    console.log(chalk.yellow(&quot;Wait for Network Idle...&quot;));
    await page.waitForNetworkIdle();
  
    // get Items
    const findElements = await page.evaluate(() =&gt; {
      const elements = document.querySelectorAll(&quot;.sale-item&quot;);
      console.log(elements);
      return elements;
    });
  
    console.log(findElements);
  
    console.log(chalk.blue(&quot;Waiting...&quot;));
    await page.waitForTimeout(10000);
  
    await browser.close();
    console.log(chalk.red(&quot;Closed.&quot;));
  })();
  </code></pre>
  <pre><code>Expected results : {
    '0': { _prevClass: 'sale-item pa-1 col-sm-6 col-md-4 col-lg-3 col-12' },
    '1': { _prevClass: 'sale-item pa-1 col-sm-6 col-md-4 col-lg-3 col-12' },
    '2': { _prevClass: 'sale-item pa-1 col-sm-6 col-md-4 col-lg-3 col-12' },
    '3': { _prevClass: 'sale-item pa-1 col-sm-6 col-md-4 col-lg-3 col-12' },
    '4': { _prevClass: 'sale-item pa-1 col-sm-6 col-md-4 col-lg-3 col-12' },
     .
     .
  }
  </code></pre>