Sign in to follow this  
Followers 0
Thatsgreat2345

IE Input Type

5 posts in this topic

This doesn't seem to want to work if anyone has some input as to why it only displays hidden, and then just quits and errors out. So it is able to grab the first just not the rest xD

If it doesn't load, just remove the wait, add a sleep then do it.

#include <IE.au3>
$oIE = _IECreate ("http://www.autoitscript.com/forum/index.php?act=Login&CODE=00")
$oForm = _IEFormGetObjByName($oIE,'LOGIN')
$oEles = _IEFormElementGetCollection($oForm)

For $oEle In $oEles
    MsgBox(0,'',$oEle.Type)
Next

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Odd. The DOM thinks the second element is a FieldSet

Check this out:

#include <IE.au3>
$oIE = _IECreate ("http://www.autoitscript.com/forum/index.php?act=Login&CODE=00")
$oForm = _IEFormGetObjByName($oIE,'LOGIN')
$oEles = _IEFormElementGetCollection($oForm)

For $oEle In $oEles
    consolewrite(_IEPropertyGet($oEle,"outerhtml") & @cr)
    consolewrite($oEle.Type & @cr)
Next

Dale

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Odd. The DOM thinks the second element is a FieldSet

Check this out:

#include <IE.au3>
$oIE = _IECreate ("http://www.autoitscript.com/forum/index.php?act=Login&CODE=00")
$oForm = _IEFormGetObjByName($oIE,'LOGIN')
$oEles = _IEFormElementGetCollection($oForm)

For $oEle In $oEles
    consolewrite(_IEPropertyGet($oEle,"outerhtml") & @cr)
    consolewrite($oEle.Type & @cr)
Next

Dale

Gotcha, will just have to go manual parsing from here on out. I am dumbfounded as to why it isn't working. I really need this since I'm making an auto-poster for every type of forum so if elements aren't named correctly got to get them based on type. Thanks for the help.

Share this post


Link to post
Share on other sites

Gotcha, will just have to go manual parsing from here on out. I am dumbfounded as to why it isn't working. I really need this since I'm making an auto-poster for every type of forum so if elements aren't named correctly got to get them based on type. Thanks for the help.

This is the first time I've seen this. It is not the documented behavior.

_IEFormElementGetCollection uses the Form.elements collection:

This collection can contain any combination of the button, input, select, and textArea objects. For compatibility with existing Web content, however, input type=image objects are excluded.

http://msdn2.microsoft.com/en-us/library/m...449(VS.85).aspx

There are several ways to easily work around this however. You can check the .tagName property of the element prior to trying to use .type or you can use _IEErrorHandlerRegister to prevent the invalid property reference from being fatal and check @error after the .type reference.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

This is the first time I've seen this. It is not the documented behavior.

_IEFormElementGetCollection uses the Form.elements collection:

http://msdn2.microsoft.com/en-us/library/m...449(VS.85).aspx

There are several ways to easily work around this however. You can check the .tagName property of the element prior to trying to use .type or you can use _IEErrorHandlerRegister to prevent the invalid property reference from being fatal and check @error after the .type reference.

Dale

Thanks works now :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0