See Here
The version in this thread will remain available until the new release has proven stable.
Dale
===============================================================
This basenote will hold the most recent version of an Internet Explorer Automation UDF Library (scroll to the bottom of this base-note post to find the link to IE.au3). All constructive feedback welcome.
See Post 3 in this thread for a growing list of examples.
Thanks,
Dale
Edit 7/9/05: Here is version T1.1 (See Update History for changes)
Edit 7/11/05: Here is version T1.2 (See Update History for changes)
Edit 7/14/05: Here is version T1.3 (See Update History for changes)
Edit 7/24/05: Here is version T1.4 (See Update History for changes)
Important: AutoIt Beta 3.1.1.63 or higher is now required to the use of the ObjName function. Beta downloads are here
Also Important: Download a current version of SciTe (and use the Beta definitions) to get rid of the ObjName error from Au3Check
Filename: IE.au3
Description: A collection of functions for creating, attaching to, reading from and manipulating Internet Explorer
Author: DaleHohm
Version: T1.4
Last Update: 7/24/05
Requirements: AutoIt3 Beta with COM support (3.1.1.63 or higher), Developed/Tested on WindowsXP Pro with Internet Explorer
Notes:
Errors associated with incorrect objects will be common user errors.
AutoIt beta 3.1.1.63 has now added an ObjName() function that will be used
to trap and report most of these errors.
This version of IE.au3 makes minimal use of this function but future release
will be enhanced to take full advantage of it.
Update History:
===================================================
T1.0 7/9/05
Initial Release - error handling is pretty basic, documentation has just begun, only initial UDF standards met
---------------------------------------------------
T1.1 7/9/05
Fixed errors with _IEQuit, _IETableGetCount and _IETableGetCollection
Added _IETableWriteToArray
---------------------------------------------------
T1.2 7/11/05
Added description text to all functions (full parameter documentation still pending)
Removed 4 _IEAttachByXXXX functions and replaced with one _IEAttach function with a mode parameter
Removed _IEForward() and _IEBack() and put functionality into the _IEAction() function
Added _IEAction() that performs many simple browser functions
Added _IEPropertyGet() that retrieves many properties of the browser
---------------------------------------------------
T1.3 7/14/05
Change _IEPropertyGet() to _IEGetProperty() (sorry, should have been that way from the beginning)
Added _IEClickImg() that allows finding and clicking on an image by alt text, name or src
Added _IETagNameAllGetCollection() to get a collection of all elements in the document
Added _IETagNameGetCollection() to get a collection of all elements in a document with a specified tagname
---------------------------------------------------
T1.4 7/24/05
Fixed bug in _IEClickImg() that only allowed exact matches instead of sub-string matches
Enhanced _IELoadWait() to work with Frame and Window objects (by drilling document readyState)
Enhanced _IELoadWait() to add a configurable delay before checking status (to allow previous actions to start execution) - default = 0 milliseconds
Added _IEBodyReadHTML() and _IEBodyWriteHTML() functions (read the page HTML, modify it and put it back!)
Fixed _IEAttach() so that certain shell variants did not cause failures (using new ObjName() function in beta 3.1.1.63 -- thanks Sven!)
===================================================
\\\ Core Functions
_IECreate()
Create an Internet Explorer Browser Window
_IENavigate()
Directs an existing browser window to navigate to the specified URL
_IEAttach()
Attach to the first existing instance of Internet Explorer where the search string sub-string matches
based on the mode selected.
_IEDocumentGetObj()
Given a Window object, returns an object associated with the embedded document
\\\ Frame Functions
_IEIsFrameSet()
Chects to see if the specified Window contains a FrameSet
_IEFrameGetCount()
Find the number of Frames (standard or iFrame) in the specified document
_IEFrameGetCollection()
Get a collection object containing the frames in a FrameSet or the iFrames on a normal page
_IEFrameGetObjByIndex()
Returns an object reference to a window within the specified frame (note that frame collection is 0 based)
This object can be used in the same manner as the InternetExplorer.Application object
_IEFrameGetObjByName()
Obtain an object reference to a frame by name
_IEFrameGetNameByIndex()
Obtain an object reference to a frame by 0-based index
_IEFrameGetSrcByIndex()
Obtain the URL references within a frame by 0-based index
_IEFrameGetSrcByName()
Obtain the URL references within a frame by name
\\\ Link Functions
_IEClickLinkByText()
Simulate a mouse click on a link with text sub-string matching the string provided
_IEClickLinkByIndex()
Simulate a mouse click on a link by 0-based index (in source order)
\\\ Image Functions
_IEClickImg()
Simulate a mouse click on an image. Match by sub-string match of alt text, name or src
\\\ Form Functions
_IEFormGetCount()
Get the count of the number of forms in the document
_IEFormGetCollection()
Obtain a collection object variable representing the frames in the document
_IEFormGetObjByIndex()
Obtain an object variable reference to a form by 0-based index
_IEFormGetObjByName()
Obtain an object variable reference to a form by name
_IEFormGetNameByIndex()
Obtain the name of a form by its 0-based index
_IEFormElementGetCount()
Obtain a count of the number of form elements within a given form
_IEFormElementGetCollection()
Obtain a collection object variable of all form elements within a given form
_IEFormElementGetObjByIndex()
Obtain a object reference to a form element within a form by 0-based index
_IEFormElementGetObjByName()
Obtain a object reference to a form element within a form by name
_IEFormElementGetTypeByIndex()
Obtain the type of a givien form element within a form by 0-based index
(button, checkbox, fileUpload, hidden, image, password, radio, reset, submit, or text)
_IEFormElementOptionGetCount()
Get count of Options within a Select drop-down form element
_IEFormElementGetValue()
Get the value of a specifid form element
_IEFormElementSetValue()
Set the value of a specified form element
_IEFormSubmit()
Submit a specified form
_IEFormReset()
Reset a specified form
\\\ Table Functions
_IETableGetCount()
Get count of tables within a document
_IETableGetCollection()
Obtain a collection object variable representing all the tables in a document
_IETableGetObjByIndex()
Obtain an object reference to a table in a document by 0-based index
_IETableWriteToArray()
Reads the contents of a table into an array.
Note: Currently, if any of the cells span more than one column, the column offsets will be incorrect
\\\ Body functions
_IEBodyReadHTML()
Retrieves the HTML inside the <body> tag of the document
_IEBodyWriteHTML()
Replaces the HTML inside the <body> tag of the document
\\\ Utility Functions
_IETagNameGetCollection()
Returns a collection object all elements in the object with the specified tagName.
The DOM is hierarchical, so if the object passed is the document object, all elements
in the docuemtn are returned. If the object passed in is an object inside the document (e.g.
a TABLE object), then only the elements inside that object are returned.
_IETagNameAllGetCollection()
Returns a collection object all elements in the document in source order.
_IELoadWait()
Wait for a browser page load to complete before returning
_IEAction()
Perform any of a set of simple actions on the Browser
_IEGetProperty()
Retrieve a select property of the Browser
_IEQuit()
Close the browser and remove the object refernce to it
Attached Files
Edited by DaleHohm, 04 May 2006 - 07:58 PM.




This topic is locked


