Adi*_* J. -1 html forms perl www-mechanize
我正在尝试自动登录网站.该网站是https://www.remind.com/log_in.使用dump_forms
不会在页面上显示任何表单.我尝试使用它来提交表单,但无法编译:
use strict;
use warnings;
use WWW::Mechanize;
my $ua = WWW::Mechanize -> new();
my $remind = 'https://www.remind.com/log_in';
$ua -> get ($remind);
$ua -> form_number(1);
my $uid = 'user@name.com';
$ua->field("uid", $uid );
my $password = 'passcode';
$ua->field("password", $password);
Run Code Online (Sandbox Code Playgroud)
但这失败了.这是错误:
Can't call method "value" on an undefined value
我不知道问题是什么.
可能$ua -> form_number(1);
是失败了,因为您试图抓取的页面(https://www.remind.com/log_in)中没有表格...
您应该分析页面,查看它的源代码(view-source:https://www.remind.com/log_in)... :-)