Jump to content

Question on scripting for Iexplore


 Share

Recommended Posts

I browsed thru the AutoIT help but could not seem to find the function that I need. Yes, I am new on this scripting language and am learning the trades as I post this question.

I would appreciate some help and advice for the following:

1. What is the function to use to detect the completion of a page load. Eg. I execute a login command via the AutoIT script. I would like to execute another function, but i need to page to complete loading 1st.

2. I know I can do a search on the particular page by executing this function Send("^f") follow by send(<text search>). However, this method would not detect strings on buttons. eg. if there is a button with the word 'Run', the Send("^f") function cannot detect it. What other options do I have. Is there another method of performing a search on the page instead of Send("^f")?

Thank you for your kind help and advice :)

Link to comment
Share on other sites

To pause script execution until page finishes loading:

#include <IE.au3>

_IELoadWait ( ByRef $o_object [, $i_delay = 0 [, $i_timeout = -1]] )

To collect form elements:

#include <IE.au3>

_IEFormElementGetCollection ( ByRef $o_object [, $i_index = -1] )

Link to comment
Share on other sites

Thanx Weaponx for your kind reference. I studied the 2 functions you gave me and understand the former one. The latter one, however, I am having some difficulty understanding.

eg: in http://gmail.google.com, there are 2 buttons. i attempt to run the _IEFormElementGetCollection function but get nothing from it. below is my sample code:

#include<IE.au3>

$oIE = _IECreate(0)

_IENavigate($oIE, "http://gmail.google.com")

_IELoadWait($oIE)

$oForm = _IEFormGetCollection ($oIE, 0)

$oQuery = _IEFormElementGetCollection ($oForm, 1)

MsgBox(0, "eof Script", $oQuery)

what i want to do is capture the text in the 2 buttons i.e the 'Sign in' and the 'Pick a name >>' button. Thanx :)

Link to comment
Share on other sites

Thanx Weaponx for your kind reference. I studied the 2 functions you gave me and understand the former one. The latter one, however, I am having some difficulty understanding.

eg: in http://gmail.google.com, there are 2 buttons. i attempt to run the _IEFormElementGetCollection function but get nothing from it. below is my sample code:

#include<IE.au3>

$oIE = _IECreate(0)

_IENavigate($oIE, "http://gmail.google.com")

_IELoadWait($oIE)

$oForm = _IEFormGetCollection ($oIE, 0)

$oQuery = _IEFormElementGetCollection ($oForm, 1)

MsgBox(0, "eof Script", $oQuery)

what i want to do is capture the text in the 2 buttons i.e the 'Sign in' and the 'Pick a name >>' button. Thanx :)

That might be working, but you can't display an object as a message string in MsgBox(). $oIE, $oForm, and $oQuery (assuming they were successfully retrieved) are all object references. You might get away with:

MsgBox(0, "eof Script", $oQuery.name)

;)

Edit: Or $oQuery.OuterText, or $oQuery.InnerText, etc...

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...