Steve26 Posted March 11, 2010 Posted March 11, 2010 Good morning all, I am in the process of trying to write a script that reads some text off of an IE window. I believe my issue is that the page I am trying to read the information from, does not have a "name" attribute. Because of this i believe the _IEFormElementGetObjByName is not working. Below is some of my code: Snippet to Read The Form: $oIE = _IECreate("http://*******") $oForm = _IEFormGetObjByName ($oIE, "userinfo") $oText = _IEFormElementGetObjByName ($oForm, "birthdate") MsgBox(0, "Form Element Value", _IEFormElementGetValue ($oText)) Form to be read: <form name="userinfo" method="POST"> <tr> <td align="right"><span class="text10">Birthdate: </span></td> <td><span class="text12" id="birthdate"><strong>21 Mar 1980</strong> </span></td> </tr> When i run the script i get the message box saying, "Form Element Value: 0". I am unable to edit the HTML for the site i am trying to access. Any help is greatly appreciated! Thanks.
Pain Posted March 11, 2010 Posted March 11, 2010 (edited) name="userinfo"id="birthdate"but then you have to use _IEGetObjById instead. Edited March 11, 2010 by Pain
Steve26 Posted March 11, 2010 Author Posted March 11, 2010 I changed the code to what you said so it gives me: $oIE = _IECreate("http://*******") $oForm = _IEFormGetObjByName ($oIE, "userinfo") $oText = _IEGetObjById ($oForm, "birthdate") MsgBox(0, "Form Element Value", _IEFormElementGetValue ($oText)) and the message box still returns 0.
Steve26 Posted March 11, 2010 Author Posted March 11, 2010 Errors that the console is sending me: --> IE.au3 V2.4-0 Warning from function _IEFormGetObjByName, $_IEStatus_NoMatch --> IE.au3 V2.4-0 Warning from function _IEGetObjById, $_IEStatus_NoMatch (birthdate) --> IE.au3 V2.4-0 Error from function _IEFormElementGetValue, $_IEStatus_InvalidDataType
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now