Created
January 12, 2020 13:11
-
-
Save moradi-morteza/9e4392c3fb95b518dc857ba4adf2f118 to your computer and use it in GitHub Desktop.
[Website Scraper]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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