LWP自动登录

LWP自动登录

my $ua = new LWP::UserAgent( cookie_jar => {} );
my $res = $ua->get( 'http://www.5rg.com/LMCK/pub/login/logon.jsp' );
my $content = $res->content;
$number = $1 if($content =~ /<td align="left">([^\f]*?)<\/td>/);

上面这段获取验证码,下面提交登录请求,怎么有误

my $form = HTML::Form->parse( $res->content(), 'http://www.5rg.com/' );
$form->value( 'member_loguser', 'paopaow2004' );
$form->value( 'member_logpass', '111111' );
$form->value( 'valid_no', '$number' );
$ua->request( $form->click );
>有误
啥误?
my $ua = new LWP::UserAgent(cookie_jar => {});
my $res = $ua->get( 'http://www.5rg.com/LMCK/pub/login/logon.jsp' );
my $content = $res->content;
$number = $1 if($content =~ /<td align="left">([^\f]*?)<\/td>/);
上面这段获取验证码,下面提交登录请求,怎么有误

my $form = HTML::Form->parse( $res->content(), $res->base );
$form->method( 'post' );
$form->action( 'http://www.5rg.com/LMCK/pub/loginCheck.jsp' );
$form->value( 'member_loguser', 'paopaow2004' );
$form->value( 'member_logpass', '111111' );
$form->value( 'valid_no', '$number' );
$ua->request( $form->click );

下面这段获取网页内容,运行提示数据有误
my $agent1 = new LWP::UserAgent();
my $request1 = new HTTP::Request('GET'=>"http://www.5rg.com/LMCK/pub/info/finfoDetail.jsp?finfo_Id=282148");
my $response1 = $agent1->request($request1);
my $document1 = $response1->content();

你们可以运行一下,帮看下到底哪有问题?
#!/usr/bin/perl

use LWP::UserAgent;
use HTML::TokeParser;
use HTML::LinkExtor;
use URI::URL;
use HTML::Form;

my $ua = new LWP::UserAgent(cookie_jar => {});
my $res = $ua->get( 'http://www.5rg.com/LMCK/pub/login/logon.jsp' );
my $content = $res->content;
$number = $1 if($content =~ /<td align="left">([^\f]*?)<\/td>/);
上面这段获取验证码,下面提交登录请求,怎么有误

my $form = HTML::Form->parse( $res->content(), $res->base );
$form->method( 'post' );
$form->action( 'http://www.5rg.com/LMCK/pub/loginCheck.jsp' );
$form->value( 'member_loguser', 'paopaow2004' );
$form->value( 'member_logpass', '111111' );
$form->value( 'valid_no', '$number' );
$ua->request( $form->click );

下面这段获取网页内容,运行提示数据有误
my $agent1 = new LWP::UserAgent();
my $request1 = new HTTP::Request('GET'=>"http://www.5rg.com/LMCK/pub/info/finfoDetail.jsp?finfo_Id=282148");
my $response1 = $agent1->request($request1);
my $document1 = $response1->content();


print "$document1";
你们可以运行一下,帮看下到底哪有问题?
好像是cookie的问题,cookie没有写入