[Israel.pm] web-based script
bruck at actcom.net.il
Tue Aug 31 07:30:04 PDT 2004
Shlomo Yona wrote:
> On Tue, 31 Aug 2004, Yuval Yaari wrote:
>> This can all be done from the shell.
>> And as much as I like to write Perl -- I'd rather use already-written
>>> [in the browser]
>>> * goto url x.y.z
>>> * login (username+password) 
>> This can be done with wget and/or lwp-request and/or curl.
> I was hoping for a snippet...
> I guess I'll RTFM...
my $url = 'http://the.url?param1=val1';
my $ua = LWP::UserAgent->new;
my $request = HTTP::Request->new(GET => $url);
my $response = $ua->request($request);
my $content = $response->content();
$content should contain the web page you downloaded.
you can find an example with method POST including passing parameters.
More information about the Perl