Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Website-AutoLogin with Internet Explorer


  • This topic is locked This topic is locked
14 replies to this topic

#1 funkey

funkey

    New Dad

  • Active Members
  • PipPipPipPipPipPip
  • 637 posts

Posted 09 September 2009 - 03:09 PM

This is a script for automatic login on websites using the Internet Explorer


Plain Text         
#include <IE.au3> $Url = 'http://www.autoitscript.com/forum/index.php?app=core&module=global&section=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.

Edited by funkey, 10 September 2009 - 02:58 PM.

Programming today is a race between software engineers striving to

build bigger and better idiot-proof programs, and the Universe

trying to produce bigger and better idiots.

So far, the Universe is winning.








#2 mesale0077

mesale0077

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 474 posts

Posted 10 September 2009 - 12:43 PM

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

#3 funkey

funkey

    New Dad

  • Active Members
  • PipPipPipPipPipPip
  • 637 posts

Posted 10 September 2009 - 03:02 PM

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! :D

Programming today is a race between software engineers striving to

build bigger and better idiot-proof programs, and the Universe

trying to produce bigger and better idiots.

So far, the Universe is winning.


#4 mesale0077

mesale0077

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 474 posts

Posted 10 September 2009 - 09:08 PM

thank you

#5 FrankwazHere

FrankwazHere

    Seeker

  • Active Members
  • 28 posts

Posted 11 September 2009 - 01:33 AM

slick, i like it.

;Frank. 


#6 Szhlopp

Szhlopp

    DC Talk JF

  • Active Members
  • PipPipPipPipPipPip
  • 469 posts

Posted 17 September 2009 - 05:45 PM

Kudos!

#7 Klexen

Klexen

    Prodigy

  • Active Members
  • PipPipPip
  • 198 posts

Posted 18 September 2009 - 11:31 PM

Very slick! Good job. :D

#8 FreeRider

FreeRider

    Adventurer

  • Active Members
  • PipPip
  • 105 posts

Posted 21 September 2009 - 12:36 PM

This is a script for automatic login on websites using the Internet Explorer


Plain Text         
#include <IE.au3> $Url = 'http://www.autoitscript.com/forum/index.php?app=core&module=global&section=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

#9 Stilgar

Stilgar

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 423 posts

Posted 21 September 2009 - 02:04 PM

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 by Stilgar, 21 September 2009 - 02:06 PM.


#10 Cowhead

Cowhead

    Seeker

  • New Members
  • 3 posts

Posted 27 November 2009 - 12:18 AM

Very nice.
Any way to configure if a site runs ActiveX?
Thanks

Edited by Cowhead, 27 November 2009 - 12:19 AM.


#11 funkey

funkey

    New Dad

  • Active Members
  • PipPipPipPipPipPip
  • 637 posts

Posted 04 December 2009 - 02:34 PM

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 to

build bigger and better idiot-proof programs, and the Universe

trying to produce bigger and better idiots.

So far, the Universe is winning.


#12 Manadar

Manadar

         

  • MVPs
  • 10,842 posts

Posted 04 December 2009 - 03:19 PM

When you do, keep in mind that forms may be contained inside a frame and won't be directly accessible through _IEFormGetCollection.

#13 USMC85

USMC85

    Seeker

  • New Members
  • 3 posts

Posted 28 May 2011 - 05:29 PM

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 :huh2:







This is a script for automatic login on websites using the Internet Explorer


Plain Text         
#include <IE.au3> $Url = 'http://www.autoitscript.com/forum/index.php?app=core&module=global&section=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.



#14 hoang193

hoang193

    Seeker

  • New Members
  • 1 posts

Posted 21 November 2011 - 09:13 PM

Help Me!
https://id.vnn.vn/login?service=http://tv.vnn.vn/LoginSSO.aspx
Thank

#15 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 21 November 2011 - 09:30 PM

Help Me!
https://id.vnn.vn/login?service=http://tv.vnn.vn/LoginSSO.aspx
Thank

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users