funkey Posted September 9, 2009 Share Posted September 9, 2009 (edited) This is a script for automatic login on websites using the Internet Explorerexpandcollapse popup#include <IE.au3> $Url = 'http://www.autoitscript.com/forum/index.php?app=core&module=global§ion=login' $User = 'user' $Pwd = 'pwd' $test = _IEAutoLogin($Url, $User, $Pwd) Func _IEAutoLogin($sUrl, $sUsername, $sPwd) ;funkey 09.09.09 $oIE = _IECreate($sUrl) _IEErrorNotify(False) _IEErrorHandlerRegister() $oForms = _IEFormGetCollection($oIE) If @error Then Return SetError(1, _IEErrorHandlerDeRegister(), $oIE) ;'no forms --> no login' Else $Index = 0 For $oForm In $oForms $oFormElements = _IEFormElementGetCollection($oForm) If IsObj($oFormElements) Then $IndexElement = 0 For $oElement In $oFormElements If $oElement.Type = 'password' Then $oPwd = _IEFormElementGetObjByName($oForm, $oElement.Name) _IEFormElementSetValue($oPwd, $sPwd) For $i = $IndexElement - 1 To 0 Step -1 $oUser = _IEFormElementGetCollection($oForm, $i) If $oUser.Type = 'text' Then _IEFormElementSetValue($oUser, $sUsername) ExitLoop EndIf Next If $oForm.action <> "0" And Not StringInStr($oForm.action, '.php') Then ;submit _IEFormSubmit($oForm, 0) _IELoadWait($oIE) Else ;click For $i = $IndexElement + 1 To $IndexElement + 10 ;check the next 10 elements $oButton = _IEFormElementGetCollection($oForm, $i) If $oButton.Type = 'submit' Then _IEAction($oButton, "click") ExitLoop EndIf Next EndIf Return SetExtended(_IEErrorHandlerDeRegister(), $oIE) EndIf $IndexElement += 1 Next EndIf $Index += 1 Next EndIf Return SetError(2, _IEErrorHandlerDeRegister(), $oIE) ;no password-field found EndFunc ;==>_IEAutoLoginHave fun! Tell me, if there are any sites you could not log in. Thank you.Edit: Better version of the script should work on far more websites. Edited September 10, 2009 by funkey satanico64 1 Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
mesale0077 Posted September 10, 2009 Share Posted September 10, 2009 thank you for this script but ı need only user no password inthe site exam site then send "aaratratarata" enter like it this code hospital appointment record #include <IE.au3> $Url = 'http://www.fffffffffffffffffffffffff.html $oIE = _IECreate($Url) sleep(200) Send("0000000000000") "user number" ????? sleep(20) Send("{ENTER}")thank you help me Link to comment Share on other sites More sharing options...
funkey Posted September 10, 2009 Author Share Posted September 10, 2009 New version of my script in post#1.It should now work on far more websites. Tell me, if there are any sites you could not log in. Thank you.mesale0077: Without link I can't help you.Also remember: This is not a general support forum! Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
mesale0077 Posted September 10, 2009 Share Posted September 10, 2009 thank you Link to comment Share on other sites More sharing options...
FrankwazHere Posted September 11, 2009 Share Posted September 11, 2009 slick, i like it. ;Frank. Link to comment Share on other sites More sharing options...
Szhlopp Posted September 17, 2009 Share Posted September 17, 2009 Kudos! RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' Link to comment Share on other sites More sharing options...
Klexen Posted September 18, 2009 Share Posted September 18, 2009 Very slick! Good job. Link to comment Share on other sites More sharing options...
FreeRider Posted September 21, 2009 Share Posted September 21, 2009 This is a script for automatic login on websites using the Internet Explorer expandcollapse popup#include <IE.au3> $Url = 'http://www.autoitscript.com/forum/index.php?app=core&module=global§ion=login' $User = 'user' $Pwd = 'pwd' $test = _IEAutoLogin($Url, $User, $Pwd) Func _IEAutoLogin($sUrl, $sUsername, $sPwd) ;funkey 09.09.09 $oIE = _IECreate($sUrl) _IEErrorNotify(False) _IEErrorHandlerRegister() $oForms = _IEFormGetCollection($oIE) If @error Then Return SetError(1, _IEErrorHandlerDeRegister(), $oIE) ;'no forms --> no login' Else $Index = 0 For $oForm In $oForms $oFormElements = _IEFormElementGetCollection($oForm) If IsObj($oFormElements) Then $IndexElement = 0 For $oElement In $oFormElements If $oElement.Type = 'password' Then $oPwd = _IEFormElementGetObjByName($oForm, $oElement.Name) _IEFormElementSetValue($oPwd, $sPwd) For $i = $IndexElement - 1 To 0 Step -1 $oUser = _IEFormElementGetCollection($oForm, $i) If $oUser.Type = 'text' Then _IEFormElementSetValue($oUser, $sUsername) ExitLoop EndIf Next If $oForm.action <> "0" And Not StringInStr($oForm.action, '.php') Then ;submit _IEFormSubmit($oForm, 0) _IELoadWait($oIE) Else ;click For $i = $IndexElement + 1 To $IndexElement + 10 ;check the next 10 elements $oButton = _IEFormElementGetCollection($oForm, $i) If $oButton.Type = 'submit' Then _IEAction($oButton, "click") ExitLoop EndIf Next EndIf Return SetExtended(_IEErrorHandlerDeRegister(), $oIE) EndIf $IndexElement += 1 Next EndIf $Index += 1 Next EndIf Return SetError(2, _IEErrorHandlerDeRegister(), $oIE) ;no password-field found EndFunc ;==>_IEAutoLogin Have fun! Tell me, if there are any sites you could not log in. Thank you. Edit: Better version of the script should work on far more websites. Nice job... What about a version working with Mozilla Firefox ? FreeRiderHonour & Fidelity Link to comment Share on other sites More sharing options...
Stilgar Posted September 21, 2009 Share Posted September 21, 2009 (edited) Nice job... What about a version working with Mozilla Firefox ?This function here is based on the FireFox version:http://www.autoitscript.com/forum/index.php?showtopic=102133 Edited September 21, 2009 by Stilgar jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
Cowhead Posted November 27, 2009 Share Posted November 27, 2009 (edited) Very nice. Any way to configure if a site runs ActiveX? Thanks Edited November 27, 2009 by Cowhead Link to comment Share on other sites More sharing options...
funkey Posted December 4, 2009 Author Share Posted December 4, 2009 This function needs a lot of improvement. When I have time I will do it.@Cowhead : Do you have an url with activex login for testing? Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
jvanegmond Posted December 4, 2009 Share Posted December 4, 2009 When you do, keep in mind that forms may be contained inside a frame and won't be directly accessible through _IEFormGetCollection. github.com/jvanegmond Link to comment Share on other sites More sharing options...
USMC85 Posted May 28, 2011 Share Posted May 28, 2011 Thanks man! That was what I needed. I wanted something like that for our Outlook Webmail for work. All I had to change was the web address and user/password. I prefer Firefox, but this is fine This is a script for automatic login on websites using the Internet Explorer expandcollapse popup#include <IE.au3> $Url = 'http://www.autoitscript.com/forum/index.php?app=core&module=global§ion=login' $User = 'user' $Pwd = 'pwd' $test = _IEAutoLogin($Url, $User, $Pwd) Func _IEAutoLogin($sUrl, $sUsername, $sPwd) ;funkey 09.09.09 $oIE = _IECreate($sUrl) _IEErrorNotify(False) _IEErrorHandlerRegister() $oForms = _IEFormGetCollection($oIE) If @error Then Return SetError(1, _IEErrorHandlerDeRegister(), $oIE) ;'no forms --> no login' Else $Index = 0 For $oForm In $oForms $oFormElements = _IEFormElementGetCollection($oForm) If IsObj($oFormElements) Then $IndexElement = 0 For $oElement In $oFormElements If $oElement.Type = 'password' Then $oPwd = _IEFormElementGetObjByName($oForm, $oElement.Name) _IEFormElementSetValue($oPwd, $sPwd) For $i = $IndexElement - 1 To 0 Step -1 $oUser = _IEFormElementGetCollection($oForm, $i) If $oUser.Type = 'text' Then _IEFormElementSetValue($oUser, $sUsername) ExitLoop EndIf Next If $oForm.action <> "0" And Not StringInStr($oForm.action, '.php') Then ;submit _IEFormSubmit($oForm, 0) _IELoadWait($oIE) Else ;click For $i = $IndexElement + 1 To $IndexElement + 10 ;check the next 10 elements $oButton = _IEFormElementGetCollection($oForm, $i) If $oButton.Type = 'submit' Then _IEAction($oButton, "click") ExitLoop EndIf Next EndIf Return SetExtended(_IEErrorHandlerDeRegister(), $oIE) EndIf $IndexElement += 1 Next EndIf $Index += 1 Next EndIf Return SetError(2, _IEErrorHandlerDeRegister(), $oIE) ;no password-field found EndFunc ;==>_IEAutoLogin Have fun! Tell me, if there are any sites you could not log in. Thank you. Edit: Better version of the script should work on far more websites. Link to comment Share on other sites More sharing options...
hoang193 Posted November 21, 2011 Share Posted November 21, 2011 Help Me! https://id.vnn.vn/login?service=http://tv.vnn.vn/LoginSSO.aspx Thank Link to comment Share on other sites More sharing options...
Valik Posted November 21, 2011 Share Posted November 21, 2011 Help Me!https://id.vnn.vn/login?service=http://tv.vnn.vn/LoginSSO.aspxThankYou fail at forums. Go away. Things you've done wrong:Used the report feature in an attempt to post to this thread.You didn't read the rules before posting or you would see that discussion of auto-login methods is not allowed (this thread was created before that rule and hasn't been locked as a result).You revived an old thread.Thread locked. Now leave and don't come back. Link to comment Share on other sites More sharing options...
Recommended Posts