centos6.5:/root/podinns/lib#cat t1.pl use LWP::UserAgent; use HTTP::Date qw(time2iso str2time time2iso time2isoz); use Net::Ping; use Socket; use Net::SMTP; use LWP; use LWP::Simple; use LWP::UserAgent; use HTTP::Cookies; use HTTP::Headers; use HTTP::Response; use Encode; use URI::Escape; use URI::URL; my $ua = LWP::UserAgent->new; $ua->timeout(5); $ua->env_proxy; $ua->agent("Mozilla/8.0"); my $cookie_jar = HTTP::Cookies->new( file=>'lwp_cookies.txt', autosave=>1, ignore_discard=>1); $ua->cookie_jar($cookie_jar); $var='https://licai.yingyinglicai.com/index.htm'; #$var='https://licai.yingyinglicai.com/user/loginByPwd.do'; my $response = $ua->get($var); if ($response->is_success) { $var= $response->decoded_content; print "$var is $var "; }; centos6.5:/root/podinns/lib#cat t1.pl use LWP::UserAgent; use HTTP::Date qw(time2iso str2time time2iso time2isoz); use Net::Ping; use Socket; use Net::SMTP; use LWP; use LWP::Simple; use LWP::UserAgent; use HTTP::Cookies; use HTTP::Headers; use HTTP::Response; use Encode; use URI::Escape; use URI::URL; my $ua = LWP::UserAgent->new; $ua->timeout(5); $ua->env_proxy; $ua->agent("Mozilla/8.0"); my $cookie_jar = HTTP::Cookies->new( file=>'lwp_cookies.txt', autosave=>1, ignore_discard=>1); $ua->cookie_jar($cookie_jar); $var='https://licai.yingyinglicai.com/index.htm'; #$var='https://licai.yingyinglicai.com/user/loginByPwd.do'; my $response = $ua->get($var); if ($response->is_success) { $var= $response->content; print "$var is $var "; };