#include "ie.au3"
$oIE = _IECreate("http://www.sdo.com/IndexIframeLogin.asp")
$oForm = _IEFormGetObjByName($oIE, "form")
$warn= _IEFormElementGetObjByName ($oForm, "warn")
$lt = _IEFormElementGetObjByName ($oForm, "lt")
;=======上面为获取表单lt的值 你可以使用其它的方法
Func _Post_Login()
$oHTTP = ObjCreate("Msxml2.xmlhttp")
$oHTTP.Open("Post","https://cas.sdo.com/CAS/Login.Validate.Account?service=http%3A%2F%2Fwww%2Esdo%2Ecom%2Fcenter%2Findex%2Easp",false)
$oHTTP.setRequestHeader("Cache-Control", "no-cache")
$oHTTP.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
;$oHTTP.Send('warn='&$warn.value&'<='&$lt.value&'&_eventId='&$_eventId.value&'&idtype='&$idtype.value&'&gamearea='&$gamearea.value&'&gametype='&$gametype.value&'&username=makerbob&password=makerbob&ekey=&challenge=&ptname=makerbo&ptpwd=makerbob&%B5%C7%C2%BC=+%B5%C7%C2%BC+')
$oHTTP.Send('warn=false<='&$lt.value&'&_eventId=submit&idtype=0&gamearea=0&gametype=0&username=makerbob&password=makerbob&ekey=&challenge=&ptname=makerbo&ptpwd=makerbob&%B5%C7%C2%BC=+%B5%C7%C2%BC+')
If @error <> 0 Then MsgBox(0,$oHTTP.Status,"登录失败!")
$Log1 = BinaryToString($oHTTP.responseBody)
;TrayTip("responseBody状态",$oHTTP.status,3)
$html2 = $oHTTP.responseText
_IEDocWriteHTML ($oIE, $html2)
EndFunc
_Post_Login()
使用表单方法#include "ie.au3"
;原网页中使用javascript传递值username和password
$oIE = _IECreate("http://www.sdo.com/IndexIframeLogin.asp")
$oForm = _IEFormGetObjByName($oIE, "form")
$username = _IEGetObjById($oIE, "username")
$username.value = 'makerbob'
$password = _IEGetObjById($oIE, "password")
$password.value = 'makerbob'
_IEFormSubmit ($oForm)
|