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 am trying to emulate right-clicking and "Saving As, complete" in Chrome or Firefox. I tried this:

wget -E -H -k -K -p

But that created a several folders, one for each domain that hosts resources. I also tried

wget -r -N -l inf --no-remove-listing -x

Both from here, if anyone is interested. I also tried here, here, and here but none of those did what I wanted.

But that did not download all the dependencies. What I really want is what Chrome and Firefox do, which creates one index.html file, with all the dependency file paths modified to point to all the dependencies that sit in an 'assests' folder next to it.

I've also tried the wget manual, and can't find anything more than what it is already doing. Is this even possible?

share|improve this question
up vote 1 down vote accepted

From the WGET manual:

--no-directories (or -nd)

Do not create a hierarchy of directories when retrieving recursively. With this option turned on, all files will get saved to the current directory, without clobbering (if a name shows up more than once, the filenames will get extensions .n).

--no-host-directories (or -nH)

Disable generation of host-prefixed directories. By default, invoking Wget with -r will create a structure of directories beginning with This option disables such behavior.

--page-requisites (or -p)

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. ...

--no-parent (or -np)

Do not ever ascend to the parent directory when retrieving recursively. This is a useful option, since it guarantees that only the files below a certain hierarchy will be downloaded.

--convert-links (or -k)

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.

Those options should help.

share|improve this answer
whoops! you already have the -k (convert-links) one. – lornix Jul 14 '12 at 20:32
This won't download css background images. – motobói Jun 13 '13 at 14:29

You must log in to answer this question.

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