找回密码
 加入
搜索
查看: 2954|回复: 4

[IE类操作] 网页内上传文件如何用ie.udf操作呢?

[复制链接]
发表于 2011-8-16 12:42:14 | 显示全部楼层 |阅读模式
本帖最后由 病毒专收员 于 2011-8-16 12:43 编辑

我想用udf自动选择需要上传的文件。我应该如何操作呢?
求解! 以下是网页源码。
<td colspan="3">
    <div id="completeFileName"></div>
    <input id="file_upload" type="file" name="fileData4youhai" />
    <input type="hidden" name="attFile" id="attFile" value="">
</td>
发表于 2011-8-16 13:10:12 | 显示全部楼层
发表于 2011-8-16 21:05:27 | 显示全部楼层
[/au3]

#include <ie.au3>
_example2()


Func _example2()
        $oIE=_IECreate('http://vote.jyb.cn/votecxdw.php',1)
        With $oIE.document.parentwindow
                .execscript(FileRead("jquery-1.6.1.min.js"))               
               
                .execscript('$("input[value=1410]").attr("checked",true)');;;选择 甘肃省教育厅    正确        最优       
;~                 .execscript('$("input[value=1410]").click()');;;选择 甘肃省教育厅    正确  次优

               
                .execscript('$("#name").val("姓名2")');;真实姓名
                .execscript('$("#address").val("甘肃省2")');;;;;地址
                .execscript('$("#identify").val("620302197511040651")');;身份证号码
                .execscript('$("#post").val("737102")');;邮编
               
;~                 .execscript('$("#submit").click()');;;;提交投票       
        EndWith
       
EndFunc


;~ [value="1410"]
;~ .attr("checked",true)

Func _example1()
        $oIE=_IECreate('http://vote.jyb.cn/votecxdw.php',1)
        $oForm=_IEFormGetObjByName($oIE,"votecxdw")
        _IEFormElementCheckBoxSelect($oForm,'1410');;;选择 甘肃省教育厅

        $oName=_IEFormElementGetObjByName($oForm,"name");;真实姓名
        $oAddress=_IEFormElementGetObjByName($oForm,"address");;地址
        $oIdentify=_IEFormElementGetObjByName($oForm,"identify");;身份证号码
        $oPost=_IEFormElementGetObjByName($oForm,"post");;邮编

        _IEFormElementSetValue($oName,'王某')
        _IEFormElementSetValue($oAddress,'甘肃省')
        _IEFormElementSetValue($oIdentify,'620302197511040651')
        _IEFormElementSetValue($oPost,'737100')
        ;~ _IEFormSubmit($oForm);;;;提交投票       
EndFunc
[/au3]
发表于 2011-8-17 14:48:11 | 显示全部楼层
发表于 2011-8-20 08:52:19 | 显示全部楼层
过来学习学习
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-21 01:34 , Processed in 0.075306 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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