Autoit提交网页表单的时候无法提交
环境:win7 , IE9浏览器网页源代码:
<body onload="javascript:document.form1.UNAME.focus();">
<div align="center">
<form name="form1" method="post" action="logincheck.php" autocomplete="off" onsubmit="return CheckForm();">
<div class="login_div" align="center">
<b>用户名</b> <input type="text" class="text" name="UNAME" maxlength="20" onmouseover="this.focus()" onfocus="this.select()" value="" />
<b>密码</b> <input type="password" class="text" name="PASSWORD" onmouseover="this.focus()" onfocus="this.select()" value="" />
<input type="submit" class="submit" value="登 录" />
</div>
<br>
<br>
</form>
AUTOIT源代码:
#include <IE.AU3>
$oIE = _IECreate("http://192.168.1.132:101/")
$Forminfo = _IEFormGetObjByName($oIE,"form1")
$oQuery = _IEFormElementGetObjByName($Forminfo,"UNAME")
_IEFormElementSetValue($oQuery,"lixiang")
$oQuery=_IEFormElementGetObjByName($Forminfo,"PASSWORD")
_IEFormElementSetValue($oQuery,"111111li")
$oQuery=_IEFormElementGetObjByName($Forminfo,"submit")
_IEAction($oQuery,"click") #include <IE.au3>
$oIE = _IECreate ("http://192.168.1.132:101/")
$oForm = _IEFormGetCollection ($oIE, 0)
$oQuery = _IEFormElementGetCollection ($oForm, 0)
_IEFormElementSetValue ($oQuery, "lixiang")
$oQuery = _IEFormElementGetCollection ($oForm, 1)
_IEFormElementSetValue ($oQuery, "111111li")
_IEFormSubmit ($oForm) 感谢楼上, 但是还是无法提交。 已经提交了,提交页面是:logincheck.php
你要看你的logincheck.php页面有无错误 不行啊, 我不用AUTOIT,点登录,都是正常的啊
页:
[1]