in reply to Extract Web Page
Hello
Yes, we can able to extract web page by using the below:
1st Step:
use strict; use warnings; use LWP::UserAgent; use HTTP::Request; my $url = 'http://www.cpan.org'; my $ua = LWP::UserAgent->new; my $request = HTTP::Request->new(GET => $url); my $response = $ua->request($request); if ($response->is_success) { print $response->content; } else { print $response->status_line, " <URL:$url>\n"; }
2nd Step:: Its very Simple:
use strict; use warnings; use LWP::Simple; getprint ('http://www.cpan.org/');
3rd Step:: we can get the web page from command promp..
C:\>lwp-download "http://www.cpan.org"
4th Step:
open MYHANDLE, "GET http://www.perlmonks.org|"; while(<MYHANDLE>) { print $_; }
Thanks
Gopal
Update Added the 4th Step.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Extract Web Page
by blazar (Canon) on May 09, 2005 at 08:10 UTC | |
|
Re^2: Extract Web Page
by polettix (Vicar) on May 09, 2005 at 10:35 UTC |