Sign in to follow this  
Followers 0
pcjunki

ie click button

11 posts in this topic

 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



#2 ·  Posted (edited)

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

this forum

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

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

 

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

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

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

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  
Followers 0