Falling Posted July 11, 2006 Posted July 11, 2006 $oIE = _IECreate ($URL) $o_form = _IEFormGetCollection ($oIE,?formindex?) What if there is 100 forms on a page? None have id's or names. What is the fastest way to find out the specific ID of a form on that page? Thanks for any info!
Falling Posted July 11, 2006 Author Posted July 11, 2006 $oIE = _IECreate ($URL) $o_form = _IEFormGetCollection ($oIE,?formindex?) What if there is 100 forms on a page? None have id's or names. What is the fastest way to find out the specific ID of a form on that page? Thanks for any info! dang can this be moved to Help forum thanks.
Moderators big_daddy Posted July 11, 2006 Moderators Posted July 11, 2006 Each form has an index #, this is based off the source order of the forms. The first form will be index 0, the second index 1, and so forth. If none of the forms have id's or name's, then that is what you will have to use.
DaleHohm Posted July 11, 2006 Posted July 11, 2006 (edited) $oIE = _IECreate ($URL) $o_form = _IEFormGetCollection ($oIE,?formindex?) What if there is 100 forms on a page? None have id's or names. What is the fastest way to find out the specific ID of a form on that page? Thanks for any info!In addition to big_daddy's advice, consider that you can iterate through the items in the collection and check their properties for what you are looking for. You can find the properties documented on MSDN (see _IE_Introduction() for a pointer). For example, every form has a .action: $oIE = _IECreate ($URL) $oForms = _IEFormGetCollection ($oIE) Dim $i = 0 For $oForm in $oForms ConsoleWrite("Index: " & $i & " Action: " & $oForm.action $i = $i + 1 Next You can also obviously check the value of $oFrom.action instead of writing it out and if it matches what you are looking for, do what you want to do with the object and ExitLoop. Food for thought... Dale Edit: typo Edited July 11, 2006 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now