Issue
I have a small web scraping application that downloads multiple files from a web application where the URLs require visting the page.
It works fine if I keep the browser instance alive in between runs, but I want to close the instance in between runs. When I call browser.close()
my downloads are stopped because the chrome instance is closed before the downloads have finished.
Does puppeteer provide a way to check if downloads are still active, and wait for them to complete? I've tried page.waitForNavigation({ waitUntil: "networkidle0" })
and "networkidle2"
, but those seem to wait indefinitely.
- node.js 8.10
- puppeteer 1.10.0
Solution
Tried doing an await page.waitFor(50000);
with a time as long as the download should take.
Or look at watching for file changes on complete file transfer
Answered By - Hellonearthis Answer Checked By - Cary Denson (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.