title: Not all DOM content is ready after waitUntil: 'domcontentloaded'
body: <p>Maybe I'm interpreting <a href="https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded" rel="nofollow noreferrer">domcontentloaded</a> wrong, but I expect all elements to be accessible at that time, and I shouldn't have a problem querying for them.</p>
  
  <p>Consider the following:</p>
  
  <pre><code>await page.goto(url, { waitUntil: 'domcontentloaded' });
  const elements = await page.$$('#myId');
  </code></pre>
  
  <p>elements.length is 0 in this case, but if I wait for the selector before querying, elements now contains the element:</p>
  
  <pre><code>await page.goto(url, { waitUntil: 'domcontentloaded' });
  await page.waitForSelector('#SignIn-emailInput'); // &lt;-- this shouldn't be required
  const elements = await page.$$('#myId');
  </code></pre>
  
  <p>Shouldn't waitUntil: 'domcontentloaded' cause goto not to resolve until all elements are ready to be queried for? Is instead waiting for 'networkidle0' the solution here, or is there a better way to know when everything is ready?</p>