![]() Specifies wether it allows downloading multiple files or notĪwait page. basics/alerts.js Download file / upload file Find an image by class selector, downloads the image, saves it to disk and read it again. alerts Create an alert dialog and close it again. My question is, is there a way to wait for a download to complete using Node+Puppeteer? I have tried using waitUntil: 'networkidle0 and networkidle2 but both seem to wait forever.Ĭode below: const path = require('path') Ĭonst browser = await puppeteer.launch() Highlights the basic Puppeteer functions. ![]() ![]() I have a script made using node.js and puppeteer which downloads a file from a button (which doesn't redirect to a url), so right now i'm using await await page.waitForTimeout(1000) to wait for the download to complete but it has a few flaws, such as:ĭepending on the connection, the download might take more than 1000ms to finish, as well as it might take less, which wouldn't make sense to wait more than what took to finish the download. ![]()
0 Comments
Leave a Reply. |