QNA > C > Come Copiare Un'intera Pagina Web, Tutto Il Codice

Come copiare un'intera pagina web, tutto il codice

è molto ovvio per ogni sviluppatore front end che vogliono conoscere il codice del sito web quando vediamo qualcosa di sorprendente sullo schermo

So che è così facile usando strumenti per sviluppatori

ma se vuoi un modo più geek ho una soluzione per questo

possiamo ottenere l'intero codice del sito web nella console inviando una richiesta HTTP GET a quel sito web.

per questo :

  1. il node.js deve essere installato nel tuo computer.(because we use http core node module to send a get request)
  2. copy the following code in a file with .js extension
  3. and run it in the console with command node filename.js
  1. var http = require('http') 
  2. var url = 'http://google.com'  
  3. //kindly change the url value i used google.com here u can use the some //other url (the website code u want to copy)  
  4. http.get(url,(response) => { 
  5.  
  6. response.on('data', (chunk) => { 
  7. console.log(chunk.toString('utf-8')) 
  8. }) 
  9. response.on('end', ()=> { 
  10. console.log('response ended') 
  11. }) 
  12. }).on('error', (error) =>{ 
  13. console.error(`error : `) 
  14. }) 

Di Donall

Perché gli obiettivi grandangolari creano immagini distorte? :: Quali sono i vantaggi di usare un obiettivo grandangolare su una fotocamera Nikon?
Link utili