Search code examples
javascriptweb-crawlerpuppeteerapify

How do I rename the output file after Apify crawls?


I've searched through the Apify documentation and I wasn't able to find a way for me to set the output file name. Right now it's {INDEX}.json but can I have a custom name for each page that Apify crawls?


Solution

  • As I understand it, you are running it locally. Then no, you cannot rename the JSON files created by Apify.pushData(). If you really need named results, you can use the Key-value store and save named JSON files there with Apify.setValue(). Docs here.