Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have posted a very similar question today but I would like to ask again with a wget/linux focus. I hope that's all right.

I need to create offline copies of web pages programmatically on a LAMP stack, preferably using PHP. I need the HTML source, attached images and CSS style sheets.

I can run things on the command line, but not install new packages.

I can do a wget --page-requisites on the pages I want to archive. This downloads everything I need, but it does not modify the downloaded HTML and CSS files to point towards the archived files.

I am looking for an extension / Perl script / shell script that modifies the downloaded document(s) to point towards the downloaded resources, or maybe a different, Linux based solution that does this. I already checked, httrack does not seem to be installed on the server ("whereis httrack" returns nothing).

share|improve this question

migrated from Nov 29 '09 at 23:05

This question came from our site for professional and enthusiast programmers.

up vote 9 down vote accepted

Try the --convert-links option:

After the download is complete, convert the links in the document to make them suitable for local viewing. This affects not only the visible hyperlinks, but any part of the document that links to external content, such as embedded images, links to style sheets, hyperlinks to non-HTML content, etc.

share|improve this answer
How could I overlook that? I will try it out and report back. – Pekka 웃 Nov 29 '09 at 14:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .