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?

2
  • What exactly you want to do?
    – stderr
    Commented Jul 20, 2013 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
    Commented Jul 20, 2013 at 3:05

1 Answer 1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .