1

I have a question, as much as I think I cannot think of the way to put all links of pictures in a list, I asked this question before but it was marked as duplicate to post where OP asked to download all pictures.

I tried wget -r -P /save/location -A jpeg,jpg http://www.domain.com but it's only downloading to computer. How can I extract a list of all images to a file?

3

use spider option and pipe the output to grep to get only the links out of them

wget --spider --force-html -r -l2 "www.domain.com" 2>&1   | grep '^--' | awk '{ print $3 }'   | grep '\.\(jpeg\|jpg\)$'

this will display all the links to the standard output, you direct it to a file:

wget --spider --force-html -r -l2 "www.domain.com" 2>&1   | grep '^--' | awk '{ print $3 }'   | grep '\.\(jpeg\|jpg\)$'>links.txt
  • thank you for your answer, but grep comand doesnt grep anythink even if u write letter 'grep a >links.txt' – Benas Gasiūnas Oct 14 '14 at 14:45
  • whole terminal just stuck and nothing happens – Benas Gasiūnas Oct 14 '14 at 14:59
  • just updated my answer with the right params – A. Wench Oct 14 '14 at 19:10

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.