我无法使用WWW :: Mechanize提交表单。
有人可以帮助我实现这个目标吗?
出于安全原因,我删除了网址信息。而作为stackoverflow的HTML代码不允许我发布完整的代码。
Perl代码
#!/usr/bin/perl
use strict;
use WWW::Mechanize;
my $url = 'http://somedomain.com/?LBID=LB0000005KPQ&SID=2887897D3C5138936D924F8117F2CF86'
my $mech = WWW::Mechanize->new;
$mech->get($url);
$mech->click_button( value => "save" );
以下是HTML的原始代码
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Date Selection</title>
</head>
<body class='yui-skin-sam' onLoad=''>
<script type="text/javascript">
YAHOO.util.Event.onContentReady('save', function(){
var saveButton = new YAHOO.widget.Button({
type: "submit",
label: "View Log",
id: "savebutton",
name: "save",
value: "save",
container: "save"
});
YAHOO.util.Event.onContentReady('cancel', function(){
var cancelButton = new YAHOO.widget.Button({
type: "button",
label: "Cancel",
id: "cancelbutton",
name: "cancel",
value: "cancel",
container: "cancel"
});
});
</script>
</div>
</body>
</html>