2

I want to crawl some file using puppeteer, and I find the downloading practice like below:

puppeteer - how to set download location

 await page._client.send('Page.setDownloadBehavior', {
                behavior: 'allow',
                downloadPath: dirname,
            });

but I want to change the filename now, some examples use "fs" module to rename it when download finished, but usually, there are many files and different names, it couldn't check it in PC file system manually, we want to click the download button and rename it at right, how can I reach it?

Will2015
  • 61
  • 6
  • 4
    Does this answer your question? [Can we somehow rename the file that is being downloaded using puppeteer?](https://stackoverflow.com/questions/57408918/can-we-somehow-rename-the-file-that-is-being-downloaded-using-puppeteer) – Selmi Karim Dec 27 '19 at 08:34

0 Answers0