2017-09-15 60 views
-1

得到一个HTML元素在一个AutoIt脚本,我通过所有元素循环与如何通过tagtype在AutoIt中

For $oElement in $oFormElements 

,并通过它的HTML类型的属性我可以识别的元素。即:

<input type="password .... /> 

等于:

If $oElement.Type = 'password' Then 

到目前为止上帝,但我可以通过它的类型属性,而是由它选择一个HTML对象没有的标签类型,即“按钮”

<button id="Test>Test</> 

我无法在autoit wiki中找到一个参考,告诉我DOM对象可以具有哪些属性。

回答

1

使用_IETagNameGetCollection

#include <IE.au3> 
Local $oIE = _IECreate("https://google.com") 
Local $oButtons = _IETagNameGetCollection($oIE, "button") 
For $oButton In $oButtons 
    Consolewrite("name: " & $oButton.name & " value: " & $oButton.value & @CRLF) 
Next