;~ #include <IE.au3>
$url = "http://hi.baidu.com/go/login"
$oIE = ObjCreate("InternetExplorer.Application")
$oIE.visible = 1
$oIE.navigate($url)
$oIE.height = @DesktopHeight
$oIE.width = @DesktopWidth
Do
Sleep(10)
Until $oIE.readyState = 4
$oIE.document.getElementById('username').value = '测试'
$oIE.document.getElementById('password').value = '$20130113'
$oEles = $oIE.document.GetElementsByTagName("a")
For $oEle In $oEles
If StringInStr($oEle.outerhtml, '<a class="qbutton button button-save data-need-verify autosubmit-button clearfix" href="###" data-needverify="click:notempty(username)|notempty(password)|notempty(?verifycode)|save">') Then ExitLoop
Next
$oEle.click()
Sleep(2000)
$oIE.navigate("http://hi.baidu.com/pub/show/createtext")
Sleep(1000)
$oIE.document.getElementById('title').value = '测试百度空间'
$oIE.document.getElementById('private').value = 0
$oEles = $oIE.document.getElementById('articlePub').document.GetElementsByTagName("input")
MsgBox(0, "1", $oEles.item(3).type)
$oEles.item(3).type = "text"
;~ 'HTML <input> 标签的 type 属性
MsgBox(0, "2", $oEles.item(3).type)
<FORM id=articlePub onsubmit="return false;" name=articlePub>
...................
<INPUT id=tags name=tags type=hidden> <INPUT id=private name=private type=hidden> <INPUT id=content name=content type=hidden> </FORM>
表单的HTML源
如何更改INPUT id=content 的属性或者如何直接提交表单? |