2017-09-15 55 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