CheesyPuffs144 Posted April 27, 2006 Share Posted April 27, 2006 Is it possible for an input button to be outside of a form? Using the little snippet athttp://www.autoitscript.com/forum/index.ph...indpost&p=95139I changed the anchor links section to search for input tags (I need to click a button), but when I found the button I wanted, (I believe that) it is not inside a form. The only thing I can tell is that they're nestled in SPAN elements. AFAIK, I can't view the source (frames leading to php which only display if called from the frame, quite clever/annoying).Is there a way I can grab the INPUT object from the collection returned from _IETagNameGetCollection() ? I know the indexes for them from the collection, just not how to grab them... Link to comment Share on other sites More sharing options...
DaleHohm Posted April 27, 2006 Share Posted April 27, 2006 Is it possible for an input button to be outside of a form? Using the little snippet athttp://www.autoitscript.com/forum/index.ph...indpost&p=95139I changed the anchor links section to search for input tags (I need to click a button), but when I found the button I wanted, (I believe that) it is not inside a form. The only thing I can tell is that they're nestled in SPAN elements. AFAIK, I can't view the source (frames leading to php which only display if called from the frame, quite clever/annoying).Is there a way I can grab the INPUT object from the collection returned from _IETagNameGetCollection() ? I know the indexes for them from the collection, just not how to grab them...Yes, _IETagNameGetCollection($oIE, "input") should work.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 Link to comment Share on other sites More sharing options...
CheesyPuffs144 Posted April 27, 2006 Author Share Posted April 27, 2006 (edited) Yes, _IETagNameGetCollection($oIE, "input") should work.DaleI have that, but how do I then grab the specific (namely the 2nd and 3rd) input objects from that collection? I can't use _IEFormElementGetObjByIndex() because its not part of any form. Edited April 27, 2006 by CheesyPuffs144 Link to comment Share on other sites More sharing options...
DaleHohm Posted April 27, 2006 Share Posted April 27, 2006 I have that, but how do I then grab the specific (namely the 2nd and 3rd) input objects from that collection? I can't use _IEFormElementGetObjByIndex() because its not part of any form.Ah... this will get a reference to the third item in the collection:$oInputs = _IETagNameGetCollection($oIE, "input") $oInput = $oInputs.item(2)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 Link to comment Share on other sites More sharing options...
CheesyPuffs144 Posted April 27, 2006 Author Share Posted April 27, 2006 $oIE = _IECreate() ... $o_frame = _IEFrameGetObjByName($oIE, "FrameName") ... $o_input = _IETagNameGetCollection($o_frame, "input") $o_button = $o_input.item(1) I get this error. $o_button = $o_input.item(1) $o_button = ^ERROR Error: Error in exp[b][/b]ression. Maybe I'm having a huge brainfart, but I don't see what's wrong... Link to comment Share on other sites More sharing options...
DaleHohm Posted April 27, 2006 Share Posted April 27, 2006 (edited) Doh! Sorry, I make this mistake every time. I'm going to make this smarter in the next release. _IETagNameGetCollection takes a document object so use $o_input = _IETagNameGetCollection($o_frame.document, "input") Dale Edited April 27, 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 Link to comment Share on other sites More sharing options...
CheesyPuffs144 Posted April 27, 2006 Author Share Posted April 27, 2006 Thank you very much! Now, is there any way to click the button? I tried $o_button.Click $o_button.fireEvent("onchange") $o_button.fireEvent("onclick") $o_button.fireEvent("onmouseup") I think I'm going about this the wrong way... Link to comment Share on other sites More sharing options...
DaleHohm Posted April 27, 2006 Share Posted April 27, 2006 Thank you very much!Now, is there any way to click the button? I tried$o_button.Click $o_button.fireEvent("onchange") $o_button.fireEvent("onclick") $o_button.fireEvent("onmouseup")I think I'm going about this the wrong way...$o_button.Clickwill click the button as though it was done with the mousethere must be something else going on... you'll need to take a closer look at the source code or post it here and I'll take a lookDale 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 Link to comment Share on other sites More sharing options...
CheesyPuffs144 Posted April 27, 2006 Author Share Posted April 27, 2006 I'll PM you then. Link to comment Share on other sites More sharing options...
DaleHohm Posted April 28, 2006 Share Posted April 28, 2006 (edited) I'll PM you then.With the HTML you sent me I was able to get the following to work:$oInputs = _IETagNameGetCollection($oFrame.document, "input") For $oInput in $oInputs If String($oInput.value) = "Cast Spell" Then $oInput.click ExitLoop EndIf NextDale Edited April 28, 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 Link to comment Share on other sites More sharing options...
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