Jump to content

Trying to click buttons in IE. Where do object names come from?


Recommended Posts

#include <IE.au3>
Local $oIE = _IE_Example("form")
Local $oForm = _IEGetObjByName($oIE, "ExampleForm")
sleep(5000)
$oSubmit = _IEGetObjByName($oIE, "submitexample")
_IEAction($oSubmit, "click")

so this example seems to work. But where does the name "Submitexample" come from? How can I find the names of other buttons?

Edited by wisem2540
Link to comment
Share on other sites

Really? Look at the webpage created by $oIE = _IE_Example("form") - I put the HTML source for the form elements right on the page... llok around.

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

  • 2 weeks later...

Maybe my initial question was unclear. What I meant to ask was....

How can I find the button info of buttons on OTHER webpages. What I am trying to do is automate webclicks on an unrelated page. I apologize for being unclear, but I still believe the sarcasm was not needed...

thanks

Link to comment
Share on other sites

Try not to waste our time with poorly worded questions and you'll probably avoid what you called sarcasm.

There are many DOM inspectors available - I suggest DebugBar (see my sig).

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

Awesome, I was able to use the "Spy" option in the debugger to find the source code. So i thought I would try something simple like clicking the OK button. According to the source, the object name is "btnok"

So i tried a controlclick command, but that didnt seem to do it. Will that not work with IE?

thanks

Link to comment
Share on other sites

  • Moderators

How about a sample URL that you're trying to manipulate? Otherwise we're just shooting in the dark.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...