Sign in to follow this  
Followers 0
sgn209

IE.au3 Click submit button without name or id ?

9 posts in this topic

Hi Autoit Forum ,
I want to learn how to click a submit  in this case
 
<a class="btn-yellow bby-submitPlaceOrder" onClick="handlePlaceOrder()">Place Order</a>
Thanks ..

Share this post


Link to post
Share on other sites



Actually you don't have to click it. You can just call this function from onClick.

$oIe.document.parentWindow.eval("handlePlaceOrder()")

Share this post


Link to post
Share on other sites

Actually you don't have to click it. You can just call this function from onClick.

$oIe.document.parentWindow.eval("handlePlaceOrder()")

 

I got this error when try it:

C:\Users\Dat\Desktop\WORK\DAT - POST.au3 (399) : ==> The requested action with this object has failed.:
$OIE.document.parentWindow.eval("handlePlaceOrder()")
$OIE.document.parentWindow.eval("handlePlaceOrder()")^ ERROR
->03:05:32 AutoIt3.exe ended.rc:1
>Exit code: 1    Time: 23.228

Share this post


Link to post
Share on other sites

Are you using ie 10?

Try

$links = $oIe.document.getElementsByClassName("btn-yellow bby-submitPlaceOrder")

For $link In $links

$link.click()

Next

You can of course change this loop if you know which occureance of this link you want to click to

$links.item(x).click()

Share this post


Link to post
Share on other sites

Are you using ie 10?

Try

$links = $oIe.document.getElementsByClassName("btn-yellow bby-submitPlaceOrder")

For $link In $links

$link.click()

Next

You can of course change this loop if you know which occureance of this link you want to click to

$links.item(x).click()

 

This one working perfectly ! Thank you very very much ! You are a hero save my life !

2 more question, i dont know why all of my script CAN'T RUN on Windows Server 2008 with IE 11 ?  Where I can find documents to about $oIe.document."something" ?

Thanks again and have a great day !

Share this post


Link to post
Share on other sites

I am trying to do the same thing, press a button on a web page using autoit.  The line of code  describing the button I am trying to press is shown below:

<TR><TD colspan=6 align=center><br><input type="button" value="Copy Your Computer's Time Settings" onclick="CopyTimeFromPC();"></TD></tr>

The web page has HTML and embedded javascript.  I can see the onclick javascript subroutine in the web page source code.  I just don't know how to activate it.

All the ieau3 functions seem to need a name or class, this has neither.

Any ideas?

Share this post


Link to post
Share on other sites

You can try either my answer from post #2 or

$inputs = $oIE.document.getElementsByTagName("input")

For $input In $inputs

If $input.value == "Copy Your Computer's Time Settings" then

$input.click()

EndIf

Next

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Thanks for the suggestions.  It worked. 

Edited by bobfii

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