登录后我使用以下代码抓取页面。几个星期前工作正常。但是,现在它在第14行死亡而没有抛出任何错误。我不知道出了什么问题
use WWW::Mechanize;
use HTTP::Cookies;
my $url = "http://smshub.mobiledigiconverse.net/MDC_CI/loginpage";
my $username = "username";
my $password = "password";
my $useragent = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0";
my $mech = WWW::Mechanize->new( agent => $useragent);
my $cookie=$mech->cookie_jar(HTTP::Cookies->new());
$mech->get($url);
my $cont1 = $mech->content();
$mech->form_name('login-form') or die;
$mech->field( uname => $username ) or die;
$mech->field( pwd => $password ) or die;
$mech->submit('Login') or die;
my $cont = $mech->content();
print $cont;
删除die语句后,将获得相同的页面内容。我想有人会遇到同样的错误。希望找到解决方案