Jump to content

_IEFormGetCollection: Cant Log In


666
 Share

Recommended Posts

I try to Login at a Side, where the Login is called with a javascript.

So i call the js and on the Side the Login pops up.

But then no Field gets filled.

The Source is:

<div class="Login_text"> 
                                                  <form action="?action=start" method=post> 
                                                              Nickname:<br /> 
                                                              <input class="input" type="text" name="form_login_name"><br /> 
                                                              Passwort:<br /> 
                                                              <input class="input" type="password" name="form_login_password"><br /> 
                                                              Server:<br /> 
                                                              <input type="radio" name="form_world" value="world1"> Welt 1 <br /> 
                                                              <input type="radio" name="form_world" value="world2"> Welt 2 <br /> 
                                                                                                                           
                                                              <input class="button" type="submit" name="login" value="Login"><br /> 
                                                              <a class="link" href="?action=start&forgotpw=true">Forgot Password?</a> 
                                                  </form> 
  </div>

As the Form has no Name, ive tried it with "_IEFormGetCollection" but without success.

My Script so far:

$name= "xyz"
$password= "xyz"


$oIE= _IECreate ($url)
_IENavigate($oIE,"javascript:Login();")
_IeLoadWait($oIE,0,8000)
$oForm = _IEFormGetCollection($oIE,1)
$sHTML = _IEDocReadHTML ($oIE)

$oUsername = _IEFormElementGetObjByname($oForm,"form_login_name")
    $oPassword = _IEFormElementGetObjByName($oForm,"form_login_password")
    
$oLogin = _IEFormElementGetObjByName($oForm,"Login")
    _IEFormElementSetValue ($oUsername,$name)
    _IEFormElementSetValue ($oPassword,$password)
    _IEFormElementSetValue ($oLogin,$login)
_IEFormElementRadioSelect($oForm, "world2", "form_world", 1, "byValue")
Sleep(1000)

_IEFormSubmit($oForm)
_IeLoadWait($oIE,0,8000)

Nothing happend with my Script except the Login-Popup.

Could someone help me with my Problem?

That would be very kind.

Link to comment
Share on other sites

Try this

$name= "xyz"
$password= "xyz"

$oIE= _IECreate ($url)
_IENavigate($oIE,"javascript:Login();")
_IeLoadWait($oIE,0,8000)
$oForm = _IEFormGetCollection($oIE,1)

$oUsername = _IEFormElementGetObjByname($oForm,"form_login_name")
_IEAction ( $oUsername, "focus" )
$hIE = _IEPropertyGet ( $oIE, "hwnd" )
ControlSend ( $hIE, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", $name )

$oPassword = _IEFormElementGetObjByName($oForm,"form_login_password")
_IEAction ( $oPassword, "focus" )
$hIE = _IEPropertyGet ( $oIE, "hwnd" )
ControlSend ( $hIE, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", $password )

$oLogin    = _IEFormElementGetObjByName($oForm,"Login")
_IEAction ( $oLogin, "focus" )
$hIE = _IEPropertyGet ( $oIE, "hwnd" )
ControlSend ( $hIE, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", $login )
        
_IEFormElementRadioSelect($oForm, "world2", "form_world", 1, "byValue")
Sleep(1000)

_IEFormSubmit($oForm)
_IeLoadWait($oIE,0,8000)

but the url would be helpfull ! Posted Image

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

I still have to take care of the login button, give me some time...Posted Image

#include <IE.au3>

$url = "http://www.farmparadies.de/"
$name= "xyz"
$password= "xyz"

$oIE= _IECreate ($url)
_IENavigate ( $oIE, "javascript:Login();", 0 )
Sleep ( 1000 )
$oForm = _IEFormGetCollection($oIE,1)
_IEFormElementRadioSelect($oForm, "welt2", "form_welt", 1, "byValue")

$oUsername = _IEFormElementGetObjByname($oForm,"form_login_name") 
_IEFormElementSetValue ($oUsername,$name)

$oPassword = _IEFormElementGetObjByName($oForm,"form_login_password")
_IEFormElementSetValue ($oPassword,$password)
Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

Try this : Posted Image

#include <IE.au3>

$url = "http://www.farmparadies.de/"
$name= "xyz"
$password= "xyz"

$oIE= _IECreate ( $url )
_IENavigate ( $oIE, "javascript:Login();", 0 )
Sleep ( 1000 )
$oForm = _IEFormGetCollection ( $oIE, 1 )
_IEFormElementRadioSelect ( $oForm, "welt2", "form_welt", 1, "byValue" )
$oUsername = _IEFormElementGetObjByname ( $oForm,"form_login_name" )
_IEFormElementSetValue ( $oUsername, $name )
$oPassword = _IEFormElementGetObjByName ( $oForm,"form_login_password" )
_IEFormElementSetValue ( $oPassword, $password )
Sleep ( 1000 )
$oElement = _IEFormElementGetObjByname ( $oForm, "login" )
_IEAction ( $oElement, "focus" )
_IEAction ( $oElement, "click" )

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

It works!

You are awesome ;)

I didnt know, that SLeep is so important.

And looks like i need to learn something about "focus" :)

Ive tried it for hours yesterday... (also ive tried it with packets, but dont worked too because if the cookie)

Many many tnx.

Edited by 666
Link to comment
Share on other sites

It works!

You are awesome ;)

I didnt know, that SLeep is so important.

And looks like i need to learn something about "focus" :)

Ive tried it for hours yesterday... (also ive tried it with packets, but dont worked too because if the cookie)

Many many tnx.

Thanks ! and good game ! Posted Image

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

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