HTTP-404 has asked for the wisdom of the Perl Monks concerning the following question:
Withou loop it works just fine, but when i make loop like this$ua = new LWP::UserAgent; $ua->agent('Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000) Opera 5. +12 [en]' . $ua->agent); $ua->agent('Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000) Opera 5. +12 [en]'); $req = HTTP::Request->new(GET => 'http://www.chollonet.com/trucoteca/ +truco.php?idjuego=598&plataforma=4'); print "$id\n"; $html=$ua->request($req)->as_string;
I get HTTP-400 bad request. How can I make loop with LWP, then? Thank You very much in advance$ua = new LWP::UserAgent; $ua->agent('Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000) Opera 5. +12 [en]' . $ua->agent); $ua->agent('Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000) Opera 5. +12 [en]'); $req = HTTP::Request->new(GET => 'http://www.chollonet.com/trucoteca/ +truco.php?idjuego=$id&plataforma=4'); #<-----JUST USE $ID insted of +number print "$id\n"; $html=$ua->request($req)->as_string;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(bbfu) Re: Batch web fetch scipt
by bbfu (Curate) on Jul 29, 2001 at 23:48 UTC | |
|
Re: Batch web fetch scipt
by mitd (Curate) on Jul 29, 2001 at 23:51 UTC |