I need your help. I wanna make a script that automatically consults some information using a code.
It´s like this. I use a website to get some information using a code. There´s a form, I fill-in a form-field and submit, then I get the result. I want to make a script that reads all the codes from a file, sends each code to that website, and get the result about that code.
So, i beleive I need a 'put' method. And how do I do so?
help me!
Diogo Nunes de Oliveira
URL/Result:
[example.br...]
My script:
#!/usr/bin/perl
use LWP::UserAgent;
$ua = LWP::UserAgent->new;
$ua->agent("MyApp/0.1 ");
$ua->cookie_jar({});
my $req = HTTP::Request->new(POST => 'http://www.example.br/online/Capital/Processos_SPG/Resp_Processo1.dml');
#my $req = HTTP::Request->new(POST => 'http://www.example.br/online/Inicial/Processos/ConsultaProc_1Grau_Capital.dml');
$req->content_type('application/x-www-form-urlencoded');
$req->content('numrproc=009600352534');
#&mode=dist');
my $res = $ua->request($req);
if ($res->is_success) {
print $res->content;
}
else {
print $res->status_line, "\n";
[edited by: jatar_k at 6:05 pm (utc) on Dec. 11, 2004]
[edit reason] generalized urls [/edit]