title: Download external website with nodejs (including resources)
body: <p>I want to download a webpage, say <a href="http://www.stackoverflow.com">http://www.stackoverflow.com</a> with nodejs. Meaning that I have an offline copy of the static page. It has to download the resources (like styles, javascript files, images etc) and update the references to local ones.</p>
  
  <p>In any case I want an offline page that once opened looks exactly like the real page. Just like what happens when I choose file->save in a web browser.</p>
  
  <p>Basically I want to replicate the function of </p>
  
  <pre><code>wget --page-requisites
  </code></pre>
  
  <p>(Although this does not download css and images properly)</p>
  
  <p>The background is that I want to execute Javascript on an external website. This is (rightly) not possible due to cross-domain-policies. To avoid this, I just want to download the website and statically host it myself, execute my Javascript analysis-code and then delete it.</p>