I want to download all images from a webpage but when I type:

$ wget -nd -r -P images -A "*.jpg, *.jpeg, *.png" "Path/to/url"

wget not only downloads images from the webpage I want but it also downloads every other image from the website and loops forever. I have to stop it with Ctrl+C.

When I change the command to:

$ wget -np -nd -r -P images -A "*.jpg, *.jpeg, *.png" "Path/to/url"

It doesn't download anything at all.

Note: When I run either of the two commands, wget always prints this message:

"Removing 'filename' since it should be rejected"

How do I use wget to download images from a webpage?

  • 1
    man wget for download options.
    – ajeh
    Aug 3, 2018 at 18:26
  • I think you simply want to download the webpage that has the images you're interested in. Then issue a wget -A "*.jpg, *.jpeg" -i ./the-page-you-downloaded
    – somebody
    Jun 17, 2019 at 20:14

1 Answer 1


try adding the -l<#> switch, where # is the number of pages you want to go down

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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