You can use GNU wget:
- free and open source
- Linux, Windows, Mac (
brew install wget
)
- CLI
To download jpeg,jpg,bmp,gif,png images of a website (you can obviously extend the list):
wget --recursive --directory-prefix /myimages/domain --accept jpeg,jpg,bmp,gif,png http://softwarerecs.stackexchange.com/
--recursive
: Turn on recursive retrieving. The default maximum depth is 5.
--directory-prefix
: Set directory prefix to prefix. The directory prefix is the directory where all other files and subdirectories will be saved to, i.e. the top of the retrieval tree. The default is . (the current directory).
--accept
: Specify comma-separated lists of file name suffixes or patterns to accept or reject. Note that if any of the wildcard characters, *, ?, [ or ], appear in an element of acclist or rejlist, it will be treated as a pattern, rather than a suffix.
Note that in the case where you just want to download the images of a page where you need to click on the image to get the full size, you might want to specify the recursion maximum depth level using --level=depth
, e.g.:
wget --recursive --level=2 --directory-prefix /myimages/domain --accept jpeg,jpg,bmp,gif,png http://softwarerecs.stackexchange.com/
--level=depth
: Specify recursion maximum depth level depth.
FYI: JavaScript Functionality For Wget.