I am trying to download an image to my hd from a webpage.

Right now I am grabbing the html source and going through it to find the link to the image. Doing this means I'm requesting it from the site twice so sometimes it times out and the image won't download after the page loads.

What I want to do is somehow get the image from the page instead of searching the source for the link and downloading it. Is this possible?