download webpage and dependencies, including css images

HtmlCssImageDownload

Html Problem Overview


Often I need to download a webpage and then edit it offline. I have tried a few tools and the main feature they lack is downloading images referenced in the CSS files.

Is there a tool (for Linux) that will download everything so that the webpage will render the same offline (excluding AJAX)?

Html Solutions


Solution 1 - Html

wget --page-requisites http://example.com/your/page.html

> This option causes Wget to download all the files that are necessary to properly display a given html page. This includes such things as inlined images, sounds, and referenced stylesheets.

EDIT: meder is right: stock wget does not parse and download css images. There is, however, a patch that adds this feature: [1, 2]

UPDATE: The patch mentioned above has been merged into wget 1.12, released 22-Sep-2009:

** Added support for CSS. This includes:
 - Parsing links from CSS files, and from CSS content found in HTML
   style tags and attributes.
 - Supporting conversion of links found within CSS content, when
   --convert-links is specified.
 - Ensuring that CSS files end in the ".css" filename extension,
   when --convert-links is specified.

Solution 2 - Html

It's possible to do this through Firefox, see this form

  1. Right click
  2. View page info
  3. Select media tab
  4. Highlight all files
  5. Save as

Reference - http://www.webdeveloper.com/forum/showthread.php?t=212610

Solution 3 - Html

I ran into the same problem the other day working for a client. Another tool that works really well is HTTrack. The software is available in a commandline verison for both windows and Linux. For Linux they prebuilt packages for most of the more common operating systems found here

For my purposes it worked better than wget with some of the added features/switches that fix links inside the html file.

Solution 4 - Html

wget is a great choice for you. Just for more information, the wget version on windows at this time there is no official release on gnu for wget version 1.12. The current version is 1.11

wget version 1.11 cannot download images/fonts in css files. Fortunately, you can find a build of 1.14 from this page. It fixed these problems.

http://opensourcepack.blogspot.com/2010/05/wget-112-for-windows.html

Solution 5 - Html

The current version of Opera (12) allows to save a page as 'HTML with images'.

Thereby Opera also downloads images which are referenced in the CSS files and adapts the image URLs in the CSS accordingly.

Solution 6 - Html

In Firefox:

File->Save Page As->Web Page, Complete

Saves all javascript and images and css. Nothing else required :)

Solution 7 - Html

wget 

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionhojuView Question on Stackoverflow
Solution 1 - Htmlax.View Answer on Stackoverflow
Solution 2 - HtmlJonathanView Answer on Stackoverflow
Solution 3 - HtmlEverette MillsView Answer on Stackoverflow
Solution 4 - HtmlTran Dang KhoaView Answer on Stackoverflow
Solution 5 - HtmlMarcoView Answer on Stackoverflow
Solution 6 - HtmlLiveSourceView Answer on Stackoverflow
Solution 7 - HtmlOscarRyzView Answer on Stackoverflow