How do I create a file in the file system and place the contents of this.getPageContent()
inside it?
var fs = require('fs'); fs.write(myfile, myData, 'w');
for saving daily scrapes I do:
var currentTime = new Date(); var month = currentTime.getMonth() + 1; var day = currentTime.getDate(); var year = currentTime.getFullYear(); var myfile = "data-"+year + "-" + month + "-" + day+".html";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With