2

I need a solution for downloading multiple images at once. It must work in GNU/Linux and it must only involve free/libre software. I would prefer a stand-alone program (command-line or GUI), but a browser extension is fine, too.

The image URLs have a number in the query component, from 1 to n:

http://example.com/path?query&id=1&foo=bar
http://example.com/path?query&id=2&foo=bar
http://example.com/path?query&id=3&foo=bar

There is no page where all images are embedded/linked.

The user should

  1. paste the first image URL,
  2. mark where the ID in the query is (or how the parameter is called),
  3. and enter how many images there are.

The program should

  1. download all images,
  2. and ideally include the ID in the file name (e.g., 1.png, 2.png, …).
5

Good old wget was pretty much made for this. (curl works, too.)

You just need to use a shell loop to invoke wget for each image. In Bash:

for N in {1..5} ; do wget "http://example.com/path?query&id=$N&foo=bar" -O $N.png ; done

Edit the range and the URL to taste. If there's an error trying to retrieve a given image, you'll see an error message and an empty file will be saved.

1

Try the Selenium IDE or iMacros - both are some kind of programmable web macro recorder:

iMacros is no out-of-the-box solution, it requires some tweaking and scripting, but is very powerful. See SAVEITEM. How to get started:

You can use the {!LOOP} variable with the URL like in http://example.com/path?query&id={{!LOOP}}1&foo=bar and then start the macro with the loop button.

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.