QNA > H > How To Download A Website (All Coding Html, Css, Javascript) And Make A Similar Website In Bootstrap

How to download a website (all coding HTML, CSS, JavaScript) and make a similar website in Bootstrap

If you know how to run npm , then there is one Useful script .

But first , do:

npm install website-scraper

Create one index.js file and put the below code in it( name can be anything)

  1. const scrape = require('website-scraper'); 
  2. const websiteUrl = 'https://www.website-name/'; 
  3.  
  4. scrape({ 
  5. urls: [websiteUrl], 
  6. urlFilter: function (url) { 
  7. return url.indexOf(websiteUrl) === 0; 
  8. }, 
  9. recursive: true, 
  10. maxDepth: 50, 
  11. prettifyUrls: true, 
  12. filenameGenerator: 'bySiteStructure', 
  13. directory: './node-website' 
  14. }).then((data) => { 
  15. console.log("Entire website succesfully downloaded"); 
  16. }).catch((err) => { 
  17. console.log("An error ocurred", err); 
  18. }); 

And in that directory run

  1. node index.js 

This takes some time. So be patient and if everything goes well, you will get a message in your console:

Entire website succesfully downloaded

Note: This is only for educational purpose. Because the website content may include copyright contents.

Di Samal

Mangiare sano è più costoso? :: Come nutrire se stessi e la propria famiglia in modo economico, ma per una salute ottimale (preferibilmente vegetariano, o quasi)
Link utili