4

I downloaded a website using:

wget -c --mirror -p http://www.somewebsite.com

for offline viewing and I just remembered that I forgot the --convert-links option! They are all on my hard drive right now. Is there a way to do --convert-links without redownloading the whole website?

7

Straightforward one: serve local directory with something like SimpleHTTPServer, then re-wget from localhost with appropriate options.

  • 1
    Quite a good idea, why the down vote? – phunehehe Feb 14 '11 at 9:32
  • 2
    I should add that one shout edit /etc/hosts to fake localhost as the website being mirrored. And this will only work well if the links all point to the same webpage (i.e no hot-linked images). – phunehehe Feb 14 '11 at 9:34
  • What is SimpleHTTPServer? Is it the Python module? If so, can you show how to use it (so I can revoke my careless downvote). – tshepang Feb 14 '11 at 13:01
  • 1
    @Tshepang Yes Python is pretty awesome with the huge load of modules :) SimpleHTTPServer is my favorite – phunehehe Feb 14 '11 at 15:10
2

Also, don't forget to use the option --timestamping, or add timestamping=on to "~/.wgetrc". It ensures that when you re-mirror the website, you don't re-download the whole website, but only changed/new files. See the section Time-Stamping in manpage of wget for more.

FWIW I use this to mirror my blog:

wget --mirror --adjust-extension --convert-links --no-cookies --timestamping http://example.com --output-file=log-blog

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.