Jump to content
Sign in to follow this  
pcjunki

ie click button

Recommended Posts

pcjunki

 how do I click on a button in ie?

I've looked and poked around the forums, tried all kinds of scripts, but still no luck

how do I launch a website, and click on a button?

here is the html code for the button I would like to click on

 

<header>
<button id="btnClickme">CLICKHERE</button> 
<div id="Clickme_menu" 
class="offscreen">
<div id="Clickme_menu_content">

</div>
</div>

 

Share this post


Link to post
Share on other sites
jdelaney

What forum searches have you done?  This has to be one of the most frequently asked questions here :)

Post what code you have attempted to use.

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites
jdelaney

the second param of _iegetobjbyid should be the value of the id attribute, not "id"

"Clickme_menu_content"

The _ieaction first param should be your $botten.

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites
pcjunki

you all are making my head spin, but I love learning

this is what I have, but still not working

 

#include <IE.au3>
Call("click")
Func click()
    Global $oIE = _IECreate("http://website.com/")
Local $oButs = _IETagNameGetCollection($oIE, "btnClickme")For $oBut 
In $oButs   If StringInStr($oBut.innertext, "CLICKHERE") Then 
_IEAction($oBut, "click")

Share this post


Link to post
Share on other sites
Arclite86

 

you all are making my head spin, but I love learning

this is what I have, but still not working

#include <IE.au3>
Call("click")
Func click()
    Global $oIE = _IECreate("http://website.com/")
Local $oButs = _IETagNameGetCollection($oIE, "btnClickme")For $oBut 
In $oButs   If StringInStr($oBut.innertext, "CLICKHERE") Then 
_IEAction($oBut, "click")

btnClickme remmber that in this must always the first word of a div, try 

#include <IE.au3>
Call("click")
Func click()
    Global $oIE = _IECreate("http://website.com/")
Local $oButs = _IETagNameGetCollection($oIE, "button")For $oBut 
In $oButs   If StringInStr($oBut.innertext, "CLICKHERE") Then 
_IEAction($oBut, "click")

Share this post


Link to post
Share on other sites
pcjunki

I'm getting this error now.

 

"C:\Program Files\AutoIt3\Include\IE.au3" (1787) : ==> No variable given for "Dim", "Local", "Global", "Struct" or "Const" statement.:
Func _IETagNameGetCollection(ByRef $o_object, $s_TagName, $i_index = -1)
Func _IETagNameGetCollection(ByRef $o_object, $s_TagNa^ ERROR

Share this post


Link to post
Share on other sites
Arclite86

I'm getting this error now.

 

"C:\Program Files\AutoIt3\Include\IE.au3" (1787) : ==> No variable given for "Dim", "Local", "Global", "Struct" or "Const" statement.:

Func _IETagNameGetCollection(ByRef $o_object, $s_TagName, $i_index = -1)

Func _IETagNameGetCollection(ByRef $o_object, $s_TagNa^ ERROR

forgot that you need to type "Next" at the end , try it agian

Share this post


Link to post
Share on other sites
pcjunki

I'm going to try this back on Monday,

it's beer time!

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.