Sign in to follow this  
Followers 0
d0n

how to click this button in IE

17 posts in this topic

i am trying to click a button in an IE page but i am not sure which _IE function to use here

i was looking at the source and i found this part of the button

<div style="padding-top:20px; margin-top:-10px; margin-bottom:10px;">
                                            <div id="acceptDiv"><button onclick="go5();">I Agree</button>&nbsp;&nbsp;<button onclick="go4();">I disagree</button></div>

Share this post


Link to post
Share on other sites



i am trying to click a button in an IE page but i am not sure which _IE function to use here

i was looking at the source and i found this part of the button

<div style="padding-top:20px; margin-top:-10px; margin-bottom:10px;">
                                            <div id="acceptDiv"><button onclick="go5();">I Agree</button>&nbsp;&nbsp;<button onclick="go4();">I disagree</button></div>

Use Autoit window info to get your ClassnameNN for any buttons

Share this post


Link to post
Share on other sites

i am trying to click a button in an IE page but i am not sure which _IE function to use here

i was looking at the source and i found this part of the button

<div style="padding-top:20px; margin-top:-10px; margin-bottom:10px;">
                                            <div id="acceptDiv"><button onclick="go5();">I Agree</button>&nbsp;&nbsp;<button onclick="go4();">I disagree</button></div>
You might try _IELinkClickByText().

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Use Autoit window info to get your ClassnameNN for any buttons

That won't work. The buttons on a web page in IE are not the same as window controls. Try your answer on an instance of IE and see what you get.

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

i ran into another problem.

when i click the link it opens up a popup window which has the I Agree button in it, how do i get the $o_object of a pop up window?

Share this post


Link to post
Share on other sites

i ran into another problem.

when i click the link it opens up a popup window which has the I Agree button in it, how do i get the $o_object of a pop up window?

You probably don't. Most IE pop-ups are actually standard Windows GUIs that respond to the normal stuff like WinWait(), ControlSend(), etc.

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

but the pop up is a new IE window

Share this post


Link to post
Share on other sites

but the pop up is a new IE window

Then you use _IEAttach() to get a reference to the other instance of IE and proceed from there with the usual _IE* stuff. If it's a simple page with nothing but an OK button, you might get away with just:
ControlSend("Your Pop-up Window Title Here", "", "", "{ENTER}")

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

i got pass the new window part by just going right to the site, however i still can't click the button, i've tried _IELinkclickbytext and _IELinkclickbyindex, what else can i try?

Share this post


Link to post
Share on other sites

There is no "link" (an <a>) in the HTML supplied.

If this is the only button on the page, it will have an index of 0 in the collection of buttons...

$oButton = _IETagnameGetCollection($oIE, "button", 0)

_IEAction($oButton, "click")

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

thanks i got it to work now, however when i try to download it by clicking the link (usually it will have a a file download window popup) nothing happens when using _IEAction to click it

Share this post


Link to post
Share on other sites

thanks i got it to work now, however when i try to download it by clicking the link (usually it will have a a file download window popup) nothing happens when using _IEAction to click it

This description stinks. Couldn't help you if I wanted to.

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

ok i'll try again

This is with script

1) click I Agree button

2) click Download

3) nothing happens

Manual clicking

1) click I agree

2) click download

3) File Download window pops asking me to save or cancel

I am stuck on part 3, not sure why after clicking it nothing happens in the script

Share this post


Link to post
Share on other sites

How do you know you clicked on the object you intended to?

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

because after clicking it in both situations it will load the page with "If your download does not start automatically after a few seconds, please click here."

if i manually click it i will see that message and show the download popup but if i use the script to click it i'll hear the click sound and see the message but no popup

Share this post


Link to post
Share on other sites

Sounds like a popup blocker. Make sure you don't have one enabled. Else, look to see if there is any exotic Javascript attached to the button... you may need to dig into it if so. You can also look at the 2nd example for _IEAction for another possibility.

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

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