DaProgrammer Posted December 6, 2007 Share Posted December 6, 2007 I've been playing with autoit for a couple of months but haven't touched the IE manipulation. so my question is can i press a button on a page without opening it ? i mean a button that looks like the browse button here a GRAY button, not a link. basically i need to open my routers address and press a button twice, can it be done with IE manipulation ??? Link to comment Share on other sites More sharing options...
DW1 Posted December 6, 2007 Share Posted December 6, 2007 should be able to AutoIt3 Online Help Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 6, 2007 Share Posted December 6, 2007 I've been playing with autoit for a couple of months but haven't touched the IE manipulation.so my question is can i press a button on a page without opening it ? i mean a button that looks like the browse button here a GRAY button, not a link.basically i need to open my routers address and press a button twice, can it be done with IE manipulation ???Look at the examples in the help file and run them for yourself in SciTE:_IEAction() for "click"_IEImgClick()_IELinkClickByIndex()_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...
DaProgrammer Posted December 11, 2007 Author Share Posted December 11, 2007 as i said i haven't used IE manupilation so ill appritiate if some could write me a simple example that i can modify for my needs. for example open Google and press the button "Google search". i dont know how to get the objects from there and stuff. Link to comment Share on other sites More sharing options...
Nahuel Posted December 11, 2007 Share Posted December 11, 2007 #include <IE.au3> ;Create the IE $oIE = _IECreate ("http://www.google.com") ;Get the input object called 'q' $oQuery= _IEGetObjByName ($oIE, "q") ;Get the button object called 'btnG' (Search in Google) $oButton= _IEGetObjByName ($oIE, "btnG") ;Set the text in the input _IEFormElementSetValue ($oQuery, "This is an example for DaProgrammer") ;Click on the button _IEAction($oButton,"click") Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 11, 2007 Share Posted December 11, 2007 as i said i haven't used IE manupilation so ill appritiate if some could write me a simple example that i can modify for my needs.for example open Google and press the button "Google search".i dont know how to get the objects from there and stuff.You mean like the EXAMPLES listed int he help file under the deceptively simple title EXAMPLE? You would like an EXAMPLE of how to open the help file and copy/paste the EXAMPLE into SciTE, so you can run the many EXAMPLES there?That really is pretty lame, you know. How about taking any one of the many EXAMPLES and trying it out. If anything doesn't work, or doesn't make sense you can then ask a specific question and cite a specific EXAMPLE that will help you understand it. 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...
DaProgrammer Posted December 11, 2007 Author Share Posted December 11, 2007 You mean like the EXAMPLES listed int he help file under the deceptively simple title EXAMPLE? You would like an EXAMPLE of how to open the help file and copy/paste the EXAMPLE into SciTE, so you can run the many EXAMPLES there?That really is pretty lame, you know. How about taking any one of the many EXAMPLES and trying it out. If anything doesn't work, or doesn't make sense you can then ask a specific question and cite a specific EXAMPLE that will help you understand it. i didn't see examples there of getting obj and stuff, tnx @ Nahuel for the example Link to comment Share on other sites More sharing options...
DaProgrammer Posted December 11, 2007 Author Share Posted December 11, 2007 ok i looked at the sorce and theres a prob... CODE<FORM method="post" ACTION="/status-welcome-common.html/connect"> <INPUT type="hidden" name="EmWeb_ns:vim:3" value="/status.html"> <INPUT type="hidden" name="EmWeb_ns:vim:5.ImServices.wanlink.1:enabled" value="true"> <INPUT type="hidden" name="EmWeb_ns:vim:19" value="true"> <INPUT type="submit" value="Connect" class="formbutton"> the button i need to press is in the last line : <INPUT type="submit" value="Connect" class="formbutton"> but the command is Obj by name and i dont see its name in that line. Link to comment Share on other sites More sharing options...
Nahuel Posted December 11, 2007 Share Posted December 11, 2007 Download DebugBar. You can get the names and id's of the objects in a website. www.debugbar.com Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 11, 2007 Share Posted December 11, 2007 i didn't see examples there of getting obj and stuff, tnx @ Nahuel for the example Look in the help file under _IEFormElementSetValue(), where there are 5 example scripts listed. Compare what Nahuel posted to:; *******************************************************; Example 2 - Get a reference to a specific form element and set its value.; In this case, submit a query to the Google search engine; *******************************************************;#include <IE.au3>$oIE = _IECreate ("http://www.google.com")$oForm = _IEFormGetObjByName ($oIE, "f")$oQuery = _IEFormElementGetObjByName ($oForm, "q")_IEFormElementSetValue ($oQuery, "AutoIt IE.au3")_IEFormSubmit ($oForm)It's nice that he customized it for you, but the demo scripts are there, and I find it hard to believe your copy of the help file is missing the examples... 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...
DaProgrammer Posted December 11, 2007 Author Share Posted December 11, 2007 Download DebugBar. You can get the names and id's of the objects in a website. www.debugbar.comtnx ill download it now hope it helps Link to comment Share on other sites More sharing options...
Nahuel Posted December 11, 2007 Share Posted December 11, 2007 Please, listen to PsaltyDS and look in the examples in the Help file. Dale took the hard job to make lots of example pages and codes. I'm sure you'll find everything there. Link to comment Share on other sites More sharing options...
DaProgrammer Posted December 11, 2007 Author Share Posted December 11, 2007 Downloaded the DebugBar but no luck as u can see in the source it has no name or ID any other ideas on how to press it ? Link to comment Share on other sites More sharing options...
Nahuel Posted December 11, 2007 Share Posted December 11, 2007 I suppose you could get the name of the form and then use _IEFormSubmit() Link to comment Share on other sites More sharing options...
DaProgrammer Posted December 11, 2007 Author Share Posted December 11, 2007 (edited) I suppose you could get the name of the form and then use _IEFormSubmit()yea but there isn't any name to get anyhows i made some progress, i used this :$oIE = _IECreate ("http://10.0.0.138/status.html")$oForm = _IEFormGetCollection ($oIE, 0)_IEFormSubmit ($oForm)and it works but i still got a few gliches.1) when it opens it asks for a pass and although i said remember i still need to press ok, how to i feed a pass with IE Create or an alternative ?2) how do i make the whole process minimized or without a window all together ? SOLVED with IECREATE("",0,0)tnx again for the help guys kinda new to IE manipulation. Edited December 11, 2007 by DaProgrammer Link to comment Share on other sites More sharing options...
Nahuel Posted December 11, 2007 Share Posted December 11, 2007 The window that asks you for the password can't be manipulated with the IE functions. Use ControlClick(). _IECreate(url,0,0) the third parameter is for wether you want it visible or not. 0 is invisible. I don't know how it'll work if it pops up the password window though... never did that. Link to comment Share on other sites More sharing options...
DaProgrammer Posted December 11, 2007 Author Share Posted December 11, 2007 The window that asks you for the password can't be manipulated with the IE functions. Use ControlClick()._IECreate(url,0,0) the third parameter is for wether you want it visible or not. 0 is invisible. I don't know how it'll work if it pops up the password window though... never did that.tnx i figured it out alredy, btw the window is hidden and the pop up shows up alone. 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