Download webpage and dependencies, including css images

Often I need to download a web page and then edit it offline. I tried several tools, and the main function that they lack is to load images referenced in CSS files.

Is there a tool (for Linux) that will load everything so that the web page displays in the same offline mode (excluding AJAX)?

+58
html css image download
Oct 17 '09 at 6:07
source share
7 answers
wget --page-requisites http://example.com/your/page.html 

This option causes Wget to download all the files necessary for the given html page to display correctly. This includes things like inline images, sounds, and style sheets.

EDIT: mediator is right: stock wget does not analyze or download css images. There is, however, a patch that adds this feature: [ 1 , 2 ] cases>

UPDATE: the patch mentioned above was merged with wget 1.12 released on September 22, 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. 
+78
Oct 17 '09 at 6:10
source share

This can be done through Firefox, see this form.

  • Right click
  • View page information
  • Select Media Tab
  • Select all files
  • Save as

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

+8
Jul 25 '11 at 1:02
source share

wget is a great choice for you. Just for more information, the wget version on windows at this time is missing the official gnu version for wget version 1.12. Current Version - 1.11

wget version 1.11 cannot upload images / fonts to css files. Fortunately, you can find build 1.14 from this page. He fixed these problems.

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

+8
Sep 13 2018-12-12T00: 00Z
source share

I encountered the same problem the other day, working with a client. Another tool that works very well is HTTrack . The software is available in command line mode for both windows and Linux. For Linux, they pre-created packages for most of the most common operating systems found here.

For my purposes, it worked better than wget with some added functions / switches that capture links inside the html file.

+6
Mar 23 '11 at 17:37
source share

The current version of Opera (12) allows you to save the page as "HTML with images."

Thus, Opera also downloads the images referenced in the CSS files, and accordingly adapts the URLs of the images in CSS.

+3
Aug 07 '13 at 14:22
source share

In Firefox:

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

Saves all javascript and images and css. Nothing more is required :)

+2
Jan 08 '13 at 10:26
source share
 wget 
-3
Oct 17 '09 at 6:10
source share



All Articles