[Israel.pm] web-based script
Uri Bruck
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
>> tools.
>>
>>> [in the browser]
>>> * goto url x.y.z
>>> * login (username+password) [1]
>>
>>
>> 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';
require HTTP::Request;
require LWP::UserAgent;
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.
here:
http://answers.google.com/answers/threadview?id=389053
you can find an example with method POST including passing parameters.
--
Thanks,
Uri
http://translation.israel.net
More information about the Perl
mailing list