javascript - CasperJS download and save file to specific location -
i'm beginner programmer , i'm trying download , temporarily save file using casperjs.
casper.start("http://www.google.fr/", function() { var path = 'c:/windows/temp/logo.png'; fs.write(path, this.download("http://www.google.fr/images/srpr/logo3w.png"), 'w'); });
i've tried opening file in photo viewer, , reads 'photo viewer not support file format'
from documentation:
istead of fs.write, use:
this.download("http://www.google.fr/images/srpr/logo3w.png", path);
hope helps.
Comments
Post a Comment