1

只需从 perl cook book 2nd ed pp. 796 复制此代码

它返回: 400 URL 必须是绝对的。

这段代码有什么问题?

#!"c:\strawberry\perl\bin\perl.exe" -w

use 5.006;
use strict;
use LWP::Simple;
use LWP::UserAgent;

my $ua = LWP::UserAgent->new();
my $resp = $ua->post("www.amazon.com/exec/obidos/search-handle-form",
                     { "url"             => "index-books",
                       "field-keywords"  => "perl"}
);
my $content = $resp->content;

print $content, "\n";
4

1 回答 1

7

您忘记了http://URL 前面的

嗯,大概http://,它可能是https://,,ftp://等等,等等。

于 2011-06-08T09:38:30.030 回答