Like my blog and my other projects? Support these projects and have some fun by checking out Oz Quiz, a 600+ question Australian history & popular culture quiz for the iPhone and iPod Touch I've co-developed.

Mirroring sites with wget

You can mirror a site using recent versions of wget by running wget -mEkp <url>. The -m turns on mirroring, -E forces a .html extension for web pages, -k makes all internal links relative so that they always work, and -p tells wget to download all the dependencies for each page, e.g. CSS and JavaScript files (although you need a fairly recent version of wget for this to work properly).

The downloading or prerequisites isn’t perfect, but it’s good enough to make a local copy of a website, or with some manual work, a complete static mirror of a site.

11:38 PM on Monday, 26/10/2009

Say something!