例如http://www.autoitx.com/post.php?action=newthread&fid=4
需要用到的表单源码为:<form method="post" id="postform"
action="post.php?&action=newthread&fid=4&extra=&topicsubmit=yes"
enctype="multipart/form-data" onsubmit="return validate(this)">
<span><input name="subject" id="subject" class="txt" value="" tabindex="1" /></span>
<select name="typeid" id="typeid">
<option value="0">分类</option><option value="1">提问</option><option value="3">已解决</option></select>
<textarea class="autosave max" name="message" id="e_textarea" tabindex="1" class="txt" style="height:300px"></textarea>
<button type="submit" id="postsubmit" value="true" name="topicsubmit" tabindex="1">
发新话题
</button>
</form>
我这样写提交不成功,请高手指教:#include <IE.au3>
#include <GUIConstantsEx.au3>
$Form1 = GUICreate("New Post", 700, 453)
$oIE = _IECreateEmbedded()
$GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 700, 453)
GUISetState(@SW_SHOW)
_IENavigate($oIE, "http://www.autoitx.com/post.php?action=newthread&fid=4")
_IELoadWait($oIE)
$oForm = _IEGetObjById($oIE, "postform")
$oQuery = _IEFormElementGetObjByName($oForm, "typeid")
$oQuery.value = "1"
$oQuery = _IEFormElementGetObjByName($oForm, "subject")
_IEFormElementSetValue($oQuery, "帖子标题")
$oQuery = _IEFormElementGetObjByName($oForm, "message")
_IEFormElementSetValue($oQuery, "帖子内容………………")
$oQuery = _IEFormElementGetObjByName($oForm, "topicsubmit")
_IEAction($oQuery, "click")
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
EndSelect
WEnd
另外,typeid的value如何通过读取源码读取取来进行选择? |