Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Fetching an Image from HTTP

by Popcorn Dave (Abbot)
on Jun 07, 2002 at 18:37 UTC ( [id://172607]=note: print w/replies, xml ) Need Help??


in reply to Fetching an Image from HTTP

LWP::Simple is definitely an easy way to go. I am using that in a project to grab news off foreign web sites that don't have RSS set up.

As far as grabbing pictures, I have found that LWP::Simple will get them as it apparently ( and someone please correct me if I'm wrong here ) grabs the entire page, code and graphics.

If you're doing this on a windows machine, those pictures you want may already be in your temporary directories and you might consider trying to get them out of there as another option. I don't know if *nix does the same thing or not but it may be another option to look at.

Btw, how are you deciding which ones to get?

You might also check out the latest issue of 2600 magazine. There was an article on grabbing pictures from websites that have the right click disabled - written in Perl.

Hope that helps!

Some people fall from grace. I prefer a running start...

Replies are listed 'Best First'.
Re: Re: Fetching an Image from HTTP
by Dog and Pony (Priest) on Jun 07, 2002 at 20:03 UTC
    As far as grabbing pictures, I have found that LWP::Simple will get them as it apparently ( and someone please correct me if I'm wrong here ) grabs the entire page, code and graphics.
    I will correct you on this one. :)

    LWP::Simple does *not* in itself grab it all. If you point it at a HTML page, it will grab the HTML. If you point it directly at an image, it will grab the image. The HTML may contain image tags (something like: <img src="image.gif" />), and browsers will automatically follow the urls given there and fetch the images too. LWP::Simple will not - if that is the way you want it, you will need to parse the HTML for those URL:s and continue to fetch. Or you use an already invented wheel, like Image::Grab suggested by wil above. :)


    You have moved into a dark place.
    It is pitch black. You are likely to be eaten by a grue.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://172607]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-25 16:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found