node-download-complete-page
Node module to download a complete html webpage.
Downloads a complete a webpage, including all resources referenced by src tags.
Install
You can install pagedownloader using the Node Package Manager (npm):
npm install pagedownloader
How to use
pagedownloader.download(url, [content], directory, [callback]);
Arguments
- url: The baseurl where the main page you want to download resides.
- content: (optional) The content of page. If you pass it, that content is used. Otherwise, the url parameter is used to get its content using a HTTP GET request.
- directory: the directory on your local machine to store the page.
- callback(err, res): (optional) A callback function which is called when the download is complete. res contains the location of the downloaded files.
Example
var pagedownloader = ; pagedownloader; // without callbackpagedownloader;
Example with the html content already provided
var pagedownloader = ; pagedownloader; // without callback:pagedownloader;