d0n Posted August 31, 2009 Share Posted August 31, 2009 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> <button onclick="go4();">I disagree</button></div> Link to comment Share on other sites More sharing options...
gogo Posted August 31, 2009 Share Posted August 31, 2009 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> <button onclick="go4();">I disagree</button></div> Use Autoit window info to get your ClassnameNN for any buttons Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 31, 2009 Share Posted August 31, 2009 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> <button onclick="go4();">I disagree</button></div> You might try _IELinkClickByText(). 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 Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 31, 2009 Share Posted August 31, 2009 Use Autoit window info to get your ClassnameNN for any buttonsThat 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. 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 Link to comment Share on other sites More sharing options...
d0n Posted August 31, 2009 Author Share Posted August 31, 2009 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? Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 31, 2009 Share Posted August 31, 2009 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. 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 Link to comment Share on other sites More sharing options...
d0n Posted August 31, 2009 Author Share Posted August 31, 2009 but the pop up is a new IE window Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 31, 2009 Share Posted August 31, 2009 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}") 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 Link to comment Share on other sites More sharing options...
d0n Posted August 31, 2009 Author Share Posted August 31, 2009 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? Link to comment Share on other sites More sharing options...
DaleHohm Posted August 31, 2009 Share Posted August 31, 2009 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 Link to comment Share on other sites More sharing options...
sandin Posted August 31, 2009 Share Posted August 31, 2009 have u tried _IEFormImageClick()? Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll Link to comment Share on other sites More sharing options...
d0n Posted August 31, 2009 Author Share Posted August 31, 2009 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 Link to comment Share on other sites More sharing options...
DaleHohm Posted August 31, 2009 Share Posted August 31, 2009 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 itThis 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 Link to comment Share on other sites More sharing options...
d0n Posted August 31, 2009 Author Share Posted August 31, 2009 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 Link to comment Share on other sites More sharing options...
DaleHohm Posted September 1, 2009 Share Posted September 1, 2009 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 Link to comment Share on other sites More sharing options...
d0n Posted September 1, 2009 Author Share Posted September 1, 2009 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 Link to comment Share on other sites More sharing options...
DaleHohm Posted September 1, 2009 Share Posted September 1, 2009 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 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