Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com Nov 29 '09 at 23:05

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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