Jump to content

IE Get Text From Browser


Recommended Posts

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:&nbsp;</span></td>
          <td><span class="text12" id="birthdate"><strong>21 Mar 1980</strong>&nbsp;</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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

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...