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

[IE类操作] 为什么没有_IEFormElementGetObjById函数

[复制链接]
发表于 2011-2-10 13:05:03 | 显示全部楼层 |阅读模式
要对某个网页进行操作,查看了该网页的源码,发现只有form id 而没有 form name,运行的时候程序提示没有找到匹配的表单,--> IE.au3 V2.4-0 Warning from function _IEFormElementGetObjByName, $_IEStatus_NoMatch。为什么没有
_IEFormElementGetObjById函数,对于只有form id 而没有 form name的网页,怎么进行表单的操作?谢谢各位!
发表于 2011-2-10 14:55:37 | 显示全部楼层
楼主试试这个
#include <IE.au3>
$oIE = _IECreate ("http://www.autoitscript.com")
$oForms = _IEFormGetCollection ($oIE)
MsgBox(0, "Forms Info", "There are " & @extended & " forms on this page")
For $oForm In $oForms
    MsgBox(0, "Form Info", $oForm.name)
Next
 楼主| 发表于 2011-2-10 16:15:09 | 显示全部楼层
回复 2# sango

谢谢帮助!我试了一下,msgbox的结果是两个0,是不是说这个网页确实不存在form name?
 楼主| 发表于 2011-2-10 17:07:57 | 显示全部楼层
本帖最后由 papapa314 于 2011-2-10 17:26 编辑

#include <IE.au3>
$oIE = _IECreate ("网页")
$oForms = _IEFormGetCollection ($oIE)
MsgBox(0, "Forms Info", "There are " & @extended & " forms on this page")
For $oForm In $oForms
    MsgBox(0, "Form Info", $oForm.id)
Next
能得到form的id,跟网页源码里的一样,就是没有name
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-21 13:47 , Processed in 0.075344 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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