in reply to LWP Post does not work.
Someone suggested to use POST. I changed the code to post. It still does not work. Any clue?
#!/usr/bin/perl -w use strict; use LWP; my $browser = LWP::UserAgent->new; my $response = $browser->post('http://www.abebooks.com', ["sts" => "t", "an" => "", "tn" => "Codex Seraphinianus", "kn" => "", "isbn" => "" ] ); die "Error: ", $response->status_line, "\n" unless $response->is_succe +ss; my $out_file = "result_seraph.html"; # where to save it open(OUT, ">$out_file") || die "Can't write-open $out_file: $!"; binmode(OUT); print OUT $response->content; close(OUT);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: LWP Post does not work.
by Anonymous Monk on Jun 14, 2011 at 04:03 UTC |