Sign in to follow this  
Followers 0
dar100111

Need help clicking on a button on webpage

9 posts in this topic

Hey All.  Hoping someone with more web experience can help me out.  I have a Go button and it show's up in the outer HTML as the below.  I only see the class.  It's not an input with an ID.  There are also more than one button with the class "x&g" on the site..

Thanks!

<BUTTON style="BACKGROUND-IMAGE: url(/OA_HTML/cabo/images/swan/btn-bg1.gif)" class=x7g onclick="submitForm('DefaultFormName',1,{'_FORM_SUBMIT_BUTTON':'customizeSubmitButtonPG2CCake'});return false" type=submit>Go</BUTTON>

Share this post


Link to post
Share on other sites



try to use find image method (the image is the button)


Share this post


Link to post
Share on other sites

Hey Alex.  Thanks for the response.  What would be the best way to go about this?  Do you have an example?  Thanks!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

look into  _IETagNameGetCollection

as in:

$oButtons = _IETagNameGetCollection($oIE, "button")

helpfile has examples

_IEAction for the click

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

Hey Jdelaney.  I tried putting the name of the button and got an error that it could not click the object.  Is this correct syntax.  It's called "Go".

$go = _IETagNameGetCollection($oie, "Go")
 _IEAction($go, "click")

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

did you read the help file?  It's not an object that's returned, it's an object collection (multiple objects)...It's expecting the 'tagname', not the tag's text value...tagname being what's in the <.*>, or "button"

Again, the help file shows you how to iterate through the collection.

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

Hey Universalist.  Sorry I am new at this.  I did read but I guess I'm just not understanding fully.  I was trying to find someone who had an actual example so that i could understand better.  I do apologize.  So if you are saying to put what's in <> then it would be along the lines of the below if I'm understanding correctly.  I really don't know much web code and I do realize I'm just fumbling my way through this.  Thank you very much for the help though!  You guys have all been great on here!

$go =  _IETagNameGetCollection($oie, "<BUTTON style="BACKGROUND-IMAGE: url(/OA_HTML/cabo/images/swan/btn-bg1.gif)" class=x7g onclick="submitForm('DefaultFormName',1,{'_FORM_SUBMIT_BUTTON':'customizeSubmitButtonPG2CCake'});return false" type=submit>Go</BUTTON>")

Share this post


Link to post
Share on other sites

I generally just throw out the answer, but I'm going to have to be adamant on this...read the helpfile...get the example in it, and look at what it's doing...if you at LEAST paste in the exact example from the helpfile, then I will help you (at least proves to me you tried something)


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

#9 ·  Posted (edited)

Thanks and again I've been at this a month and the help file is great.

This is the example in the help file that you are referring too?  I checked this out.  I realize I'm new here but it's not a form name or I'm missing something on what to replace here.  I mean at this point I would pay someone hourly to help me if you can point me in the right direction.  I tried this example below as it spit off a bunch of message boxes that didn't look anything like the text in the button tag.  I'm really not trying to be lazy.  I'm confused as to what this is doing and i just want to understand it.  My first script I didn't have any problems identifying input boxes, buttons, or check boxes in the forms but I'm guessing I just got lucky and the forwardair website i used has good coding.  I went and watched a video on youtube tonight about html and learned  </> this is a tag so i get that.  I just want to understand without putting some lines in my code that I can't replicate again without knowing what they are doing.  Again thanks for the help.

 

#include <IE.au3>

Local $oIE = _IE_Example("form")  <<do I put my form name here that I've already identified in the script
Local $oInputs = _IETagNameGetCollection($oIE, "input") <is this looking for an input box or does it need to be "button"
For $oInput In $oInputs
    MsgBox(0, "Form Input Type", "Form: " & $oInput.form.name & " Type: " & $oInput.type)
Next

Edited by dar100111

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