- 论坛徽章:
- 0
|
接上,希望前辈们不要嫌烦,刚刚起步,有些蹒跚。
#! /usr/bin/perl -w
use LWP::UserAgent;
my $browser = LWP::UserAgent->new;
my $url = 'http://bbs.chinaunix.net/logging.php?action=login';
my $response = $browser->post( $url,
{
"formhash" => "eb595b8d",
"styleid" => "1",
"cookietime" => "0",
"loginfield" => "username",
"questionid" => "0",
"username" => "username",
"password" => "password",
}
);
if ($response->is_success) {
open CP, ">new.html";
print CP $response->content;
}
else {
print $response->status_line, "\n";
} |
|