Jump to content
Sign in to follow this  
AcidCorps

IE Problem

Recommended Posts

AcidCorps

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

Share this post


Link to post
Share on other sites
DjDeep00

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

Share this post


Link to post
Share on other sites
AcidCorps

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

Share this post


Link to post
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
Sign in to follow this  

×