Modify

Opened 12 years ago

Closed 10 years ago

#2865 closed Bug (No Bug)

Autoit crash with NodeList on For In loop

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: 3.3.12.0 Severity: None
Keywords: Cc:

Description

$document = ObjCreate("HTMLFILE")
$document.write('<input type="hidden" name="test"/>')
$inputs = $document.querySelectorAll("input")
For $item = 0 To $inputs.length -1
	ConsoleWrite($inputs.item($item).name & @CRLF)
Next

For To loop work fine, but For In leads to hard crash:

For $input In $inputs
	ConsoleWrite($input.name & @CRLF)
Next

And it looks like a fall occurs when the script exits

Attachments (0)

Change History (3)

comment:1 by jchd18, 12 years ago

All I get is that:

"C:\Users\...\tmp\d.au3" (17) : ==> The requested action with this object has failed.:
$inputs = $document.querySelectorAll("input")
$inputs = $document^ ERROR

comment:2 by anonymous, 12 years ago

Try this. You need ie version >9+

#include <ie.au3>
$oIe = _IECreate('http://www.autoitscript.com/forum/', 1)
$inputs = $oIe.document.querySelectorAll("input")
For $input In $inputs
	ConsoleWrite($input.name & @CRLF)
Next

but in this example autoit crash browser

comment:3 by mLipok, 10 years ago

Resolution: No Bug
Status: newclosed

This is related to IE object.

This was discussed and solved here:
https://www.autoitscript.com/forum/topic/181376-_iequeryselectorall/?do=findComment&comment=1303644

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.