我试图编写一个程序,通过此网址http://t.co/AJsqOs2Q16
将产品添加到您的购物车这是我脚本的一部分
use WWW::Mechanize;
my $mech = WWW::Mechanize->new();
$tconike = "http://t.co/AJsqOs2Q16";
$mech->get($tconike);
$mech->submit_form(
form_number=> 2,
fields => {
skuId => $shoesize,
click => "ADD TO CART",
}
);
print $mech->uri();
当它运行时,我收到此错误消息
WWW::Mechanize::_die('Error ', 'GET', 'ing ', 'URI::_foreign=SCALAR(0x3b
9b7b8)', ': ', 'Protocol scheme \'javascript\' is not supported') called at C:/U
sers/Brett/Documents/brett/Perl/perl/site/lib/WWW/Mechanize.pm line 2833
WWW::Mechanize::die('WWW::Mechanize=HASH(0x34299f0)', 'Error ', 'GET', '
ing ', 'URI::_foreign=SCALAR(0x3b9b7b8)', ': ', 'Protocol scheme \'javascript\'
is not supported') called at C:/Users/Brett/Documents/brett/Perl/perl/site/lib/W
WW/Mechanize.pm line 2480
WWW::Mechanize::_update_page('WWW::Mechanize=HASH(0x34299f0)', 'HTTP::Re
quest=HASH(0x43f9d08)', 'HTTP::Response=HASH(0x43f7428)') called at C:/Users/Bre
tt/Documents/brett/Perl/perl/site/lib/WWW/Mechanize.pm line 2312
WWW::Mechanize::request('WWW::Mechanize=HASH(0x34299f0)', 'HTTP::Request
=HASH(0x43f9d08)') called at C:/Users/Brett/Documents/brett/Perl/perl/site/lib/W
WW/Mechanize.pm line 1844
WWW::Mechanize::submit('WWW::Mechanize=HASH(0x34299f0)') called at C:/Us
ers/Brett/Documents/brett/Perl/perl/site/lib/WWW/Mechanize.pm line 1955
WWW::Mechanize::submit_form('WWW::Mechanize=HASH(0x34299f0)', 'form_numb
er', 2, 'fields', 'HASH(0x3dec360)') called at getsearchentities1.pl line 70
这是一个结束所有这个程序永远不会在这个网址上工作,或者是否有办法解决它,比如使用WWW::Mechanize
之外的其他内容或在WWW::Mechanize
中执行其他操作可以解决这个问题(或者让我朝着正确的方向前进)或者这是不会有效的?
谢谢。