Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

download webpage and dependencies, including css images [closed]

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)?

like image 655
hoju Avatar asked Oct 17 '09 06:10

hoju


People also ask

How do I download all HTML and css files of a website?

Open up the webpage and click File-> Save Page As... and from that prompt select "Web Page, Complete" . Once you've saved this page this downloads a complete version of the html, javascript, css files and images that are referenced in the HTML.

How do I download an entire website source code?

To download a website's HTML source code, navigate using your favorite browser to the page, and then select SAVE PAGE AS from the FILE menu. You'll then be prompted to select whether you want to download the whole page (including images) or just the source code. The download options are common for all browsers.

How do I download a webpage from all linked pages?

On PCs. On Windows, Mac, and Linux, simply press Ctrl + S keys on your keyboard, while using any browser, to bring up the “Save page” dialog and simply save the page in your preferred directory. An HTML file and a folder containing all the data will be saved.


1 Answers

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. 
like image 62
ax. Avatar answered Sep 18 '22 07:09

ax.