Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Grabbing a Web Page

by btrott (Parson)
on Aug 27, 2000 at 22:45 UTC ( #29919=note: print w/replies, xml ) Need Help??


in reply to Grabbing a Web Page

Here you go; this will save the contents of the page to $page.
use LWP::Simple; my $page = get 'http://www.perl.com/';
If you want to write it directly to a file (it doesn't sound like you want to do this, but perhaps...), you can use the getstore routine.
use LWP::Simple; getstore('http://www.perl.com/', 'foo.html');

Replies are listed 'Best First'.
RE: Re: Grabbing a Web Page
by Anonymous Monk on Aug 28, 2000 at 00:23 UTC
    The Perl Cookbook by Tom Christiansen and Nathan Torkington has a 5-page write-up on "Fetching a URL from a Perl Script" using the "Use LWP::Simple; $content = get ($URL);" syntax you discuss.

    This O'Reilly book might be worth a look if you have it around. I have always gotten the impression that author Tom Christiansen along with Randal Schwartz and Larry Wall are the trinity of holy Perl worship and are each worthy of reverence from humble initiates.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (1)
As of 2023-09-24 03:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?