Sign in to follow this  
Followers 0
DaProgrammer

Help with IE manipulation

17 posts in this topic

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


Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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.


Share this post


Link to post
Share on other sites

#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")

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 ^_^


Share this post


Link to post
Share on other sites

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.


Share this post


Link to post
Share on other sites

Download DebugBar. You can get the names and id's of the objects in a website. www.debugbar.com

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Download DebugBar. You can get the names and id's of the objects in a website. www.debugbar.com

tnx ill download it now hope it helps :)


Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 ?


Share this post


Link to post
Share on other sites

I suppose you could get the name of the form and then use _IEFormSubmit()

Share this post


Link to post
Share on other sites

#15 ·  Posted (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 by DaProgrammer

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.


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