Skip to content

Instantly share code, notes, and snippets.

@moradi-morteza
Created January 12, 2020 13:11
Show Gist options
  • Save moradi-morteza/9e4392c3fb95b518dc857ba4adf2f118 to your computer and use it in GitHub Desktop.
Save moradi-morteza/9e4392c3fb95b518dc857ba4adf2f118 to your computer and use it in GitHub Desktop.
[Website Scraper]
https://ourcodeworld.com/articles/read/374/how-to-download-the-source-code-js-css-and-images-of-a-website-through-its-url-web-scraping-with-node-js
npm install website-scraper
// create a file index.js
const scrape = require('website-scraper');
let options = {
urls: ['https://nodejs.org/'],
directory: './node-homepage',
};
scrape(options).then((result) => {
console.log("Website succesfully downloaded");
}).catch((err) => {
console.log("An error ocurred", err);
});
//then for run
node ./index.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment