Using Wget to download single images from a website using the the img src URL where img class="decoded"

0

I want to get single images off a website. The website has photos. Clicking on the photos leads to another page. I want to get the photos from the img src tag in the html. I already have unix code to extract the img src lines I want.

Example: img src="http://website.com/photo.php?user_id=231&photo_id=23&thumbnail=1&SID=kdede19f8z1t38be1"

When I use wget to download this URL, I get a null file.

When I manually enter this URL into my browser, the image loads in the middle of the screen. When I click on the properties, it is a JPEG file. When I look at the html source for the page, it gives the following:

<html><head> … </head><body><img class="decoded" src="http://website.com/photo.php?user_id=231&photo_id=23&thumbnail=1&SID=kdede19f8z1t38be1" alt="http://website.com/photo.php?user_id=231&photo_id=23&thumbnail=1&SID=kdede19f8z1t38be1"></img></body></html>

The only thing I can figure is that it has to do with the tag:

<img class="decoded"

Any ideas?

Mike

Posted 2013-07-20T02:02:47.530

Reputation: 11

What exactly you want to do? – stderr – 2013-07-20T02:50:55.257

I figured it out. Because the site is php, I needed to add --trust-server-names as an argument to the wget command. Once I did that, I was able to download the image. – Mike – 2013-07-20T03:05:36.650

Answers

0

I figured it out. Because the site is php, I needed to add --trust-server-names as an argument to the wget. Once I did that, I could download the image without a problem.

Mike

Posted 2013-07-20T02:02:47.530

Reputation: 11