如何使用_IEFormElementRadioSelect没有找到一个Form [英] How to use _IEFormElementRadioSelect without finding a Form
问题描述
我需要这个剧本的工作,但没有使用 _IEFormGetObjByName
或 _IEFormGetCollection
,在只知道名称
单选按钮。
I need this script to work, but without using _IEFormGetObjByName
or _IEFormGetCollection
, and while knowing only the Name
of the radio buttons.
$oIE = _IE_Example ("form")
$oDoc = _IEDocGetObj($oIE)
$oArray = $oDoc.getElementsByTagName ("input")
For $element In $oArray
If $element.Name = "radioExample" Then
_IEFormElementRadioSelect ($oDoc,2, "radioExample", 1, "byIndex")
msgbox(0,"","Found it")
Endif
Next
_IEFormElementGetValue
&安培; _IEAction
工作的伟大,只是他们参考 $ oElement
,并搜索合适的 $ element.Name
,但我不能让_IEFormElementRadioSelect工作。
_IEFormElementGetValue
& _IEAction
work great, just reference them to the $oElement
, and search for an appropriate $element.Name
, but I can't get the _IEFormElementRadioSelect to work.
从AutoIt的帮助文件中找到的示例脚本的 _IEFormElementRadioSelect
命令之间唯一的区别是参照 $沃达柯
。在帮助文件,这是 $ oForm
,它发现有 _IEFormGetObjByName
,我不能使用(该网站我自动化不返回任何形式)。
The only difference between the _IEFormElementRadioSelect
command from the example script found in the AutoIt helpfile is the reference to $oDoc
. In the helpfile this is $oForm
, which is found with a _IEFormGetObjByName
, which I can't use (the site I'm automating doesn't return any forms).
推荐答案
替换您的 _IEFormElementRadioSelect
与 _IEAction($元素,点击)
试试这个例子;你可以看到被选择的无线电项目作为脚本运行:
Try this example; you can see the radio items being selected as the script runs:
#include <IE.au3>
$oIE = _IE_Example("form")
$oDoc = _IEDocGetObj($oIE)
$oArray = $oDoc.getElementsByTagName("input")
For $element In $oArray
If $element.Name = "radioExample" Then
_IEAction($element, "click")
Sleep(2000)
EndIf
Next
这篇关于如何使用_IEFormElementRadioSelect没有找到一个Form的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!