oceanwind 发表于 2011-5-22 20:49:59

登陆按钮无ID 该咋办呢(已解决)

本帖最后由 oceanwind 于 2011-5-23 12:38 编辑

这个网站登陆按钮无ID
http://www.chaoke.us/forum.php?mod=viewthread&tid=5795&extra=page%3D1&page=1
用下面的代码提交不了请高手指教谢谢先
以下为代码:
#include <IE.au3>
$oIE= _IECreate ("http://www.chaoke.us/forum.php?mod=viewthread&tid=5795&extra=page%3D1&page=1")
_IELoadWait($oIE)
$oForms = _IEFormGetCollection ($oIE)
$username = _IEGetObjByID($oIE, "ls_username")
$username.value = "aaaaaaa"
$pas = _IEGetObjByID($oIE, "ls_password")
$pas.value = "bbbbbbb"
_IEFormSubmit ($oForms)

以下为网页源码片断

<p>
<span class="ftid">
<select name="fastloginfield" id="ls_fastloginfield" width="45" tabindex="900">
<option value="username">用户名</option>
<option value="uid">UID</option>
<option value="email">Email</option>
</select>
</span>
<script type="text/javascript">simulateSelect('ls_fastloginfield')</script>
<input type="text" name="username" id="ls_username" autocomplete="off" class="px vm" tabindex="901" />
&nbsp;<input type="checkbox" name="cookietime" id="ls_cookietime" class="pc" value="2592000" tabindex="903" /> <label for="ls_cookietime">记住密码</label>
</p>
<p>
<label for="ls_password" class="z psw_w">密码</label> <input type="password" name="password" id="ls_password" class="px vm" autocomplete="off" tabindex="902" onfocus="lsShowmore()" />
&nbsp;<button type="submit" class="pn vm"><em>登录</em></button>
</p>

cxlater 发表于 2011-5-23 12:08:08


$oForms = _IEFormGetCollection ($oIE ,0)

oceanwind 发表于 2011-5-23 12:24:29

OK了 谢谢.....
页: [1]
查看完整版本: 登陆按钮无ID 该咋办呢(已解决)