如此?
;一个自动登陆起点中文网的例子
#include <IE.au3>
$url = 'www.qidian.com';url
$name = '';账户
$pwd = '';密码
$oIE = _IECreate($url, 0, 1, 1, 0)
$oForm = _IEFormGetObjByName($oIE, "aspnetForm");获取表单名
$oQuery1 = _IEFormElementGetObjByName($oForm, "txtUserName");获取名为txtUserName的元素
_IEFormElementSetValue($oQuery1, $name);输入账号
$oQuery2 = _IEFormElementGetObjByName($oForm, "txtPwd");获取名为txtPwd的元素
_IEFormElementSetValue($oQuery2, $pwd);输入密码
$sub = _IEFormElementGetObjByName($oForm, "btnLogin");获取登录按钮的ID
_IEAction($sub, "click");点击登录按钮
Sleep(8000)
_IEAction($oIE, "quit");退出
|