找回密码
 加入
搜索
查看: 3598|回复: 3

[IE类操作] 无FORM的网页怎么实现INPUT自动输入

[复制链接]
发表于 2011-3-3 11:56:15 | 显示全部楼层 |阅读模式
此网页有INPUT控件但无FORM表单项,怎么实现自动输入用户名和密码呢?部分代码如下
<body>
                <div id="qo-login-panel">
                        <img src="./SysManager/images/blank.gif" class="qo-login-logo qo-abs-position" />

                        <div class="qo-login-benefits qo-abs-position"></div>
<!--
                        <img src="./SysManager/images/blank.gif" class="qo-login-screenshot qo-abs-position" />
-->
                        <label id="field1-label-userAccount" class="qo-abs-position" accesskey="e" for="field1">
                                <span class="key"></span>用户名称:
                        </label>
                        <input class="qo-abs-position" type="text" name="field1-userAccount" id="field1-userAccount" value="" />

                        <label id="field2-label-userPwd" class="qo-abs-position" accesskey="p" for="field2">
                                <span class="key"></span>用户密码:
                        </label>
                        <input class="qo-abs-position" type="password" name="field2-userPwd" id="field2-userPwd" value="" />
                        <input id="submitBtn" class="qo-login-submit qo-abs-position" type=submit value="登录" />
                </div>

        </body>
发表于 2011-3-3 14:19:34 | 显示全部楼层
$sUrl = "test.htm";网页,作为测试,可将你在贴子中的网页代码存为test.htm文件
$oIE = _IECreate($sUrl)
$oQuery = _IEGetObjById($oIE,"field1-userAccount")
$oQuery.value = "用户名";输入用户名

$oQuery = _IEGetObjById($oIE,"field2-userPwd")
$oQuery.value = "密码";输入密码

$oQuery = _IEGetObjById($oIE,"submitBtn")
_IEAction($oQuery,"click");点登陆
_IELoadWait($oIE)
 楼主| 发表于 2011-3-7 17:20:10 | 显示全部楼层
本帖最后由 mpf1240 于 2011-3-7 17:25 编辑

谢谢,解决了!不胜感激!
发表于 2011-3-17 16:20:24 | 显示全部楼层
thanks!!!good example....
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-6-17 01:58 , Processed in 0.079298 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表