|
发表于 2010-1-19 08:08:48
|
显示全部楼层
本帖最后由 smartzbs 于 2010-1-19 08:10 编辑
分析该网页form有3个:login_form,sf和login
[login_FORM]
@=login.php,post
jumpurl=http://bbs.d9soft.com/login.php,hidden
step=2,hidden
cktime=31536000,hidden
lgt=0,select-one
pwuser=输入用户名,text
pwpwd=0,password
0= 登 录 ,submit
[sF]
@=search.php?#submit,
step=2,hidden
method=AND,hidden
sch_area=0,hidden
f_fid=all,hidden
sch_time=all,hidden
keyword=0,text
submit= ,submit
[login]
@=login.php?,post
forward=0,hidden
jumpurl=http://bbs.d9soft.com/index.php,hidden
step=2,hidden
lgt=0,radio
pwuser=0,text
pwpwd=0,password
hideid=0,radio
cktime=0,radio
submit=登录,submit
--------------------------
搜索是[sF],登陆是[login_FORM],显示是[login],因此标准的写法操作的form是[login_FORM]:
#include <ie.au3>
$oIE=_IECreate("http://bbs.d9soft.com/login.php")
$oForm = _IEFormGetObjByName ($oIE, "login_FORM")
$oQuery = _IEFormElementGetObjByName ($oForm, "pwuser")
_IEFormElementSetValue ($oQuery, "user")
$oQuery = _IEFormElementGetObjByName ($oForm, "pwpwd")
_IEFormElementSetValue ($oQuery, "pwd")
Sleep(1000);该网页要求1秒以上提交
_IEFormSubmit ($oForm)
-------------------------------------
如果你要同时显示的话,可以加上几行没用的代码:
#include <ie.au3>
$oIE=_IECreate("http://bbs.d9soft.com/login.php")
;显示
$oForm = _IEFormGetObjByName ($oIE, "login")
$oQuery = _IEFormElementGetObjByName ($oForm, "pwuser")
_IEFormElementSetValue ($oQuery, "user")
$oQuery = _IEFormElementGetObjByName ($oForm, "pwpwd")
_IEFormElementSetValue ($oQuery, "pwd")
;MsgBox(0,0,"查看")
;提交
$oForm = _IEFormGetObjByName ($oIE, "login_FORM")
$oQuery = _IEFormElementGetObjByName ($oForm, "pwuser")
_IEFormElementSetValue ($oQuery, "user")
$oQuery = _IEFormElementGetObjByName ($oForm, "pwpwd")
_IEFormElementSetValue ($oQuery, "pwd")
Sleep(1000);该网页要求1秒以上提交
_IEFormSubmit ($oForm)
---------------------------------------------
代码中"user"表示用户名,"pwd"表示密码,请设为你自己的。
分析该网页的代码为:
$oIE=_IECreate("http://bbs.d9soft.com/login.php")
myGetIeForms($oIE)
;将网页上的Form结构存入ini文件
Func myGetIeForms($o_IE,$s_form_outFile="form.ini")
FileDelete($s_form_outFile)
If IsObj($o_IE) Then
Local $oForms = _IEFormGetCollection ($o_IE)
Local $oForm
;MsgBox(0, "Forms Info", "There are " & @extended & " forms on this page")
For $oForm In $oForms
Local $oQuerys = _IEFormGetObjByName ($o_IE, $oForm.name), $oQuery
IniWrite($s_form_outFile,$oForm.name, "@",$oForm.action & ","&$oForm.method )
For $oQuery In $oQuerys
;MsgBox(0, $oForm.name, $oQuery.name)
IniWrite($s_form_outFile,$oForm.name, $oQuery.name, $oQuery.value&","&$oQuery.type)
Next
Next
Return 1
Else
Return 0
EndIf
EndFunc |
评分
-
查看全部评分
|