我正在使用WWW::Mechanize
自动将我的电子邮件地址添加为首选地址。经过很多困难后,我可以登录该页面,但是当我尝试将电子邮件地址添加为允许的电子邮件地址时,它不起作用。连链接都不显示。我究竟做错了什么?亚马逊页面的链接是这个。
我的代码:
use WWW::Mechanize;
use HTTP::Cookies;
use HTML::Form;
use WWW::Mechanize::Link;
my $bot = WWW::Mechanize->new();
$bot->agent_alias( 'Linux Mozilla' );
$bot->cookie_jar( HTTP::Cookies->new(file => "cookies.txt",
autosave => 1,
ignore_discard => 1, ) );
# Connect to the login page
my $response = $bot->get( 'https://www.amazon.com/gp/css/homepage.html/' );
# Get the login form. You might need to change the number.
$bot->form_number(3);
# Enter the login credentials.
$bot->field( email => 'email' );
$bot->field( password => 'pass' );
$response = $bot->click();
#print $response->decoded_content;
$bot->get( 'https://www.amazon.com/gp/digital/fiona/manage?ie=UTF8&*Version*=1&*entries*=0#pdocSettings' );
my @links = $bot->find_all_links( tag => "a" );
foreach (@links)
{
print $_->text()."\n" ;
}
我的篡改数据是这个
Referer=https://www.amazon.com/gp/digital/fiona/manage?ie=UTF8&%2AVersion%2A=1&%2Aentries%2A=0
POSTDATA=sid=183-7190983-6755358&newEmail=myid%40mailhost.com
编辑:搜索后我意识到它WWW::Mechanize
可能无法实现这一点,因为它缺乏 JavaScript 支持。我决定使用WWW::Scripter
插件。有人可以告诉我该怎么做吗?