IanN1990

IE Automation

6 posts in this topic

#1 ·  Posted (edited)

Hello All, 

Its been a while since i last posted but i could never say away from autoit for long :)

I am having issue with a script.

I am using the function _IEGetObjByID shown below in a basic example

 

#include <IE.au3>

Local $oIE = _IE_create("examplewebsite.com")
Local $oSubmit= _IEGetObjById($oIE, "Go")
_IEAction($oSubmit, "click")

Now the script works perfectly. The problem is on the website i am using it has two "Go" buttons and this script only clicks the first.

How would i work around this?

Ian

P.S The website in the code is an example, as the target website is run through a intranet. So i only have access to it

Edited by IanN1990

Share this post


Link to post
Share on other sites



That other's having no access is ok, but you can help other's to help you: Please paste Code of the website. _IEBodyReadHTML will help to get the needed Informations.

Share this post


Link to post
Share on other sites

You will need to show us the site source code of the button.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Unfortunately its a company website, so i cant not post anything like that i am afraid.

 

Surely this problem must be quite common though? To have two "items" with the same name?

In the help file it mentions an option for indexing using -1 instead of 0. Does this return a list of all the items found with the word Go? If so how would i access that index

Edited by IanN1990

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Following your advice though, looking at the HTML i see they are both very similar but with a few differences.

 

How could i search for a "item" by the value only

 

Example. value="Go" or perhaps Input Onclick

Edited by IanN1990

Share this post


Link to post
Share on other sites

Posting only a portion of the source code should not violate any company privacy. You will need to show us some source code for the second button.

Alternatively i would advise you to check _IETagNameGetCollection

 

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