Jump to content

IE Problem


Recommended Posts

I'm working on a script that opens up a page and clicks a couple buttons then closes but I keep getting an error

The script:

$oIE = _IECreate('http://underground-gamer.com/savetheworld.php')
    $oBody = _IEBodyReadText($oIE)
    If StringInStr($oBody, 'Not logged in!') Then 
        $oForm = _IEFormGetCollection($oIE, 0)
        $oUser = _IEFormElementGetCollection($oForm, 0)
        $oPass = _IEFormElementGetCollection($oForm, 1)
        _IEFormElementSetValue($oUser, 'XXXXXX')
        _IEFormElementSetValue($oPass, 'XXXXXX')
        _IEFormSubmit($oForm)
        _IELoadWait($oIE)
    EndIf
    $oForm = _IEFormGetCollection($oIE, 6)
    $o1 = _IEFormElementGetCollection($oForm, 0)
    $o2 = _IEFormElementGetCollection($oForm, 1)
    $o3 = _IEFormElementGetCollection($oForm, 2)
    $o4 = _IEFormElementGetCollection($oForm, 3)
    $o5 = _IEFormElementGetCollection($oForm, 4)
    $o6 = _IEFormElementGetCollection($oForm, 5)
    $o7 = _IEFormElementGetCollection($oForm, 6)
    _IEAction($o1, 'click')
    _IEQuit($oIE)

The Error:

CODE
--> IE.au3 V2.3-1 Warning from function _IEFormGetCollection, $_IEStatus_NoMatch

--> IE.au3 V2.3-1 Error from function _IEFormElementGetCollection, $_IEStatus_InvalidDataType

--> IE.au3 V2.3-1 Error from function _IEFormElementGetCollection, $_IEStatus_InvalidDataType

--> IE.au3 V2.3-1 Error from function _IEFormElementGetCollection, $_IEStatus_InvalidDataType

--> IE.au3 V2.3-1 Error from function _IEFormElementGetCollection, $_IEStatus_InvalidDataType

--> IE.au3 V2.3-1 Error from function _IEFormElementGetCollection, $_IEStatus_InvalidDataType

--> IE.au3 V2.3-1 Error from function _IEFormElementGetCollection, $_IEStatus_InvalidDataType

--> IE.au3 V2.3-1 Error from function _IEFormElementGetCollection, $_IEStatus_InvalidDataType

--> IE.au3 V2.3-1 Error from function _IEAction, $_IEStatus_InvalidDataType

Link to comment
Share on other sites

You are getting those warnings because after you login you try to get the form collection but there are no forms. Use the following to find out if the page has any forms...

$oForm = _IEFormGetCollection($oIE)

MsgBox(0, "Forms Info", "There are " & @extended & " forms on this page")

Edited by DjDeep00
Link to comment
Share on other sites

You are getting those warnings because after you login you try to get the form collection but there are no forms. Use the following to find out if the page has any forms...

$oForm = _IEFormGetCollection($oIE)

MsgBox(0, "Forms Info", "There are " & @extended & " forms on this page")

I'm using Web Developer 1.1.4 for FireFox but maybe I put the wrong number into the collection, thanks letting me know where to look

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