title: Download a working local copy of a webpage
body: <p>I would like to download a local copy of a web page and get all of the css, images, javascript, etc.  </p>
  
  <p>In previous discussions (e.g. <a href="https://stackoverflow.com/questions/706934/download-an-offline-version-of-a-webpage">here</a> and <a href="https://superuser.com/questions/130306/suggestions-for-a-site-ripper">here</a>, both of which are more than two years old), two suggestions are generally put forward: <code>wget -p</code> and <a href="http://www.httrack.com" rel="noreferrer">httrack</a>.  However, these suggestions both fail.  I would very much appreciate help with using either of these tools to accomplish the task; alternatives are also lovely.  </p>
  
  <p><br />
  <strong>Option 1: <code>wget -p</code></strong></p>
  
  <p><code>wget -p</code> successfully downloads all of the web page's prerequisites (css, images, js).  However, when I load the local copy in a web browser, the page is unable to load the prerequisites because the paths to those prerequisites haven't been modified from the version on the web. </p>
  
  <p>For example:</p>
  
  <ul>
  <li>In the page's html, <code>&lt;link rel="stylesheet href="/stylesheets/foo.css" /&gt;</code> will need to be corrected to point to the new relative path of <code>foo.css</code></li>
  <li>In the css file, <code>background-image: url(/images/bar.png)</code> will similarly need to be adjusted.</li>
  </ul>
  
  <p>Is there a way to modify <code>wget -p</code> so that the paths are correct?</p>
  
  <p><br />
  <strong>Option 2: <a href="http://www.httrack.com" rel="noreferrer">httrack</a></strong></p>
  
  <p><code>httrack</code> seems like a great tool for mirroring entire websites, but it's unclear to me how to use it to create a local copy of a single page.  There is a great deal of discussion in the httrack forums about this topic (e.g. <a href="http://forum.httrack.com/readmsg/19088/index.html" rel="noreferrer">here</a>) but no one seems to have a bullet-proof solution.</p>
  
  <p><br />
  <strong>Option 3: another tool?</strong></p>
  
  <p>Some people have suggested paid tools, but I just can't believe there isn't a free solution out there.</p>