Webmasters Stack Exchange is a question and answer site for pro webmasters. 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'm using wget -A to download images from a page.
This works fine, when images are hosted on the same domain as the page.
But this won't download images hotlinked from other pages (e.g. imageshack)

How can I download the external images as well using wget or similar tool?

share|improve this question

closed as off topic by John Conde Dec 1 '12 at 0:51

Questions on Webmasters Stack Exchange are expected to relate to webmastering within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

You need the -H (resp. --span-hosts) parameter. It enables downloading of linked resources that are hosted at different hosts/domains.

In addition you may block specific domains with --exclude-domains (Example: --exclude-domains=example.com,example.org)

share|improve this answer
The first sentence solves the problem as per the post, in my opinion. Someone should mark this answer as correct. – Sridhar-Sarnobat Apr 22 '14 at 3:24

You have to specify the domain you allow wget to follow using -D [domain list] or --domains=[domain list] (coma separated)

Note: I don't know if it handles wildcards.

share|improve this answer

Some adminsys (me included) block the wget user-agent on some files to avoid hotlinking (for example).

There are also other tools like wget: cURL, httpie, etc.. but they also can be blocked by their user-agent.

So it might not be a problem from you, but from domain you are querying.

share|improve this answer

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