If we are unaware of how many list items are fetched, how to choose selectors and wait for all list items being loaded. Lets imagine they are fetched through ajax.
Lets say following is the vague html fetched and at max 5 li elements. We are not already aware of how many exist on a particular fetch. But maybe in the real scenario there could be 100 list items.
<ul class='container'>
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
<li>item 4</li>
<li>item 5</li>
</ul>
What should be our puppeteer wait api or whatever thats appropriate which is the simplest way to fetch without missing anything.
Do methods like following work ? (but it still seems vague, and mostly results in navigation or some other errors)
await page.evaluate(() =>
document.querySelector('.container').childNodes.length>3
);