【发布时间】:2014-07-31 01:19:14
【问题描述】:
当我执行代码时,它会给出 302 Moved Temporarily 错误 如果您发现此代码中有任何错误,请告诉我们。
#!C:\Perl64\bin\perl
print "Content-type: text/html\n\n";
# seraph.pl - search for Codex Seraphinianus on abebooks
use strict;
my $out_file = "result_seraph.html"; # where to save it
use LWP;
my $browser = LWP::UserAgent->new;
my $response = $browser->post('http://dogbert.abebooks.com/abe/BookSearch',
# That's the URL that the real form submits to.
[
"ph" => "2",
"an" => "",
"tn" => "Codex Seraphinianus",
"pn" => "",
"sn" => "",
"gpnm" => "All Book Stores",
"cty" => "All Countries",
"bi" => "Any Binding",
"prl" => "",
"prh" => "",
"sortby" => "0",
"ds" => "100",
"bu" => "Start Search",
]
);
die "Error: ", $response->status_line, "\n"
unless $response->is_success;
open( OUT, ">$out_file" ) || die "Can't write-open $out_file: $!";
binmode(OUT);
print OUT $response->content;
close(OUT);
print "Bytes saved: ", -s $out_file, " in $out_file\n";
我可以对其进行哪些更正请告诉我
【问题讨论】:
-
您尝试对其进行哪些更正?