Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
What exactly you want to do? –  QMechanic73 Jul 20 '13 at 2:50
    
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 Jul 20 '13 at 3:05

1 Answer 1

up vote 0 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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