Sign in to follow this  
Followers 0
CheesyPuffs144

Input Button Without Form?

10 posts in this topic

Is it possible for an input button to be outside of a form? Using the little snippet at

http://www.autoitscript.com/forum/index.ph...indpost&p=95139

I 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...

Share this post


Link to post
Share on other sites



Is it possible for an input button to be outside of a form? Using the little snippet at

http://www.autoitscript.com/forum/index.ph...indpost&p=95139

I 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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Yes, _IETagNameGetCollection($oIE, "input") should work.

Dale

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.

Edited by CheesyPuffs144

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

$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...

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 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

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...

Share this post


Link to post
Share on other sites

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.Click

will click the button as though it was done with the mouse

there 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 look

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

I'll PM you then.

Share this post


Link to post
Share on other sites

#10 ·  Posted (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
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

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