I'm using this code to download files. I just hide the urls for security reasons. In the code below how can I check if the puppeteer has finished downloading the file
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
await page.setDefaultNavigationTimeout(0);
await page.goto('https://');
await page.waitForSelector('#aaa');
await page.goto('https://');
await page.waitForSelector('#bbb');
await page.goto('https://');