Jump to content
Sign in to follow this  
jacq99

Login to my mail account bluemail

Recommended Posts

jacq99

Hello,

I am a beginner and have a basic question. I have tried to script the login to my email http://www.bluewin.ch/fr/email/ without any success (username & password are not filled in). I have adapted posted examples like hotmail. I do not know whether my issue is due to the frame structure. Any help would be very useful!

#include <IE.au3>
_IEErrorHandlerRegister()

$username = "xyz"
$password = "xyz"
$URL = "http://www.bluewin.ch/fr/email/"

$oIE =_IECreate($URL);opens the webpage

; get pointers to the login form and username and password fields
$o_form = _IEFormGetObjByName($oIE, "ssologin")
;$o_form = _IEFormGetCollection($oIE, 0)
$o_login = _IEFormElementGetObjByName($o_form, "user")
$o_password = _IEFormElementGetObjByName($o_form, "password")
$o_submit = _IEFormElementGetObjByName($o_form, "login")

; Set field values and submit the form
_IEFormElementSetValue($o_login, $username)
_IEFormElementSetValue($o_password, $password)
;_IEFormSubmit($o_form)

_IEAction($o_submit, "click")

Exit

PS I have tried the function _IEFrameGetObjByName() since the page contains frame, but did not manage to make it working.

Share this post


Link to post
Share on other sites
Szhlopp

Hello,

I am a beginner and have a basic question. I have tried to script the login to my email http://www.bluewin.ch/fr/email/ without any success (username & password are not filled in). I have adapted posted examples like hotmail. I do not know whether my issue is due to the frame structure. Any help would be very useful!

#include <IE.au3>
_IEErrorHandlerRegister()

$username = "xyz"
$password = "xyz"
$URL = "http://www.bluewin.ch/fr/email/"

$oIE =_IECreate($URL);opens the webpage

; get pointers to the login form and username and password fields
$o_form = _IEFormGetObjByName($oIE, "ssologin")
;$o_form = _IEFormGetCollection($oIE, 0)
$o_login = _IEFormElementGetObjByName($o_form, "user")
$o_password = _IEFormElementGetObjByName($o_form, "password")
$o_submit = _IEFormElementGetObjByName($o_form, "login")

; Set field values and submit the form
_IEFormElementSetValue($o_login, $username)
_IEFormElementSetValue($o_password, $password)
;_IEFormSubmit($o_form)

_IEAction($o_submit, "click")

Exit

PS I have tried the function _IEFrameGetObjByName() since the page contains frame, but did not manage to make it working.

Try my password manager from my sig. It should enable you to auto-login.

As far as coding it your self, you need to make sure you're grabbing the right items. Use this:

#include <IE.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
;

$webAdd = "https://www.###.com"


$gui1 = GUICreate("Form1", 471, 214, 193, 125)
$List1 = GUICtrlCreateList("", 0, 0, 185, 188, $WS_BORDER + $WS_VSCROLL + $WS_TABSTOP + $LBS_NOTIFY)
$webaddr = GUICtrlCreateInput($webAdd, 197, 10, 250, 21)
$field = GUICtrlCreateInput("", 198, 44, 250, 21)
$Button1 = GUICtrlCreateButton("Set field", 256, 86, 108, 38, 0)
GUISetState(@SW_SHOW)



$oIE = _IECreate ($webAdd, 0, 0)




FindUserName($oIE)
_IEQuit($oIE)







While 1
    
    Switch GUIGetMsg()
        
        Case $GUI_EVENT_CLOSE
            Exit
            
        Case $button1
            $oIE = _IECreate ($webAdd)
            ;FindUserName($oIE)
            $selitem = _GUICtrlListBox_GetCurSel($list1)
            $seltext = _GUICtrlListBox_GetText($list1, $selitem)
            $formNum = Int(StringLeft($seltext, 2))
            $oForm = _IEFormGetCollection ($oIE, $formNum)
            $IEelements = _IEFormElementGetCollection ($oForm, $selitem)
            _IEFormElementSetValue($IEelements, GUICtrlRead($field))
            
            
    EndSwitch
    
    
    
WEnd


Func FindUserName($oIE)
$oForms = _IEFormGetCollection ($oIE)
$iNumForms = @extended

For $A = 0 to $iNumForms - 1
    
    $oForm = _IEFormGetCollection ($oIE, $A)
    $ocollection = _IEFormElementGetCollection ($oForm)
    $Elecount = @extended
    Global $IEelements[Int($Elecount)]
    For $I = 0 to $Elecount - 1
        
        $IEelements[$I] = _IEFormElementGetCollection ($oForm, $I)
        _GUICtrlListBox_AddString($list1, $A & " " & $I + 1 & ") " & $IEelements[$I].name)
        
        
    Next
    
    

Next


EndFunc

"0 1 ) Name"

First number = form ID

Second = object ID of that form.

Hope that helps!

Share this post


Link to post
Share on other sites
DjDeep00

Try my password manager from my sig. It should enable you to auto-login.

As far as coding it your self, you need to make sure you're grabbing the right items. Use this:

#include <IE.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
;

$webAdd = "https://www.###.com"


$gui1 = GUICreate("Form1", 471, 214, 193, 125)
$List1 = GUICtrlCreateList("", 0, 0, 185, 188, $WS_BORDER + $WS_VSCROLL + $WS_TABSTOP + $LBS_NOTIFY)
$webaddr = GUICtrlCreateInput($webAdd, 197, 10, 250, 21)
$field = GUICtrlCreateInput("", 198, 44, 250, 21)
$Button1 = GUICtrlCreateButton("Set field", 256, 86, 108, 38, 0)
GUISetState(@SW_SHOW)



$oIE = _IECreate ($webAdd, 0, 0)




FindUserName($oIE)
_IEQuit($oIE)







While 1
    
    Switch GUIGetMsg()
        
        Case $GUI_EVENT_CLOSE
            Exit
            
        Case $button1
            $oIE = _IECreate ($webAdd)
            ;FindUserName($oIE)
            $selitem = _GUICtrlListBox_GetCurSel($list1)
            $seltext = _GUICtrlListBox_GetText($list1, $selitem)
            $formNum = Int(StringLeft($seltext, 2))
            $oForm = _IEFormGetCollection ($oIE, $formNum)
            $IEelements = _IEFormElementGetCollection ($oForm, $selitem)
            _IEFormElementSetValue($IEelements, GUICtrlRead($field))
            
            
    EndSwitch
    
    
    
WEnd


Func FindUserName($oIE)
$oForms = _IEFormGetCollection ($oIE)
$iNumForms = @extended

For $A = 0 to $iNumForms - 1
    
    $oForm = _IEFormGetCollection ($oIE, $A)
    $ocollection = _IEFormElementGetCollection ($oForm)
    $Elecount = @extended
    Global $IEelements[Int($Elecount)]
    For $I = 0 to $Elecount - 1
        
        $IEelements[$I] = _IEFormElementGetCollection ($oForm, $I)
        _GUICtrlListBox_AddString($list1, $A & " " & $I + 1 & ") " & $IEelements[$I].name)
        
        
    Next
    
    

Next


EndFunc

"0 1 ) Name"

First number = form ID

Second = object ID of that form.

Hope that helps!

No, this will not help/work. This is a bit tricky since it involves iEFrames. I believe in order to make this work you will need to do the following:

$oFrame = _IEGetObjById($oIE, "frame name");Download debugbar
$sSrc = $oFrame.src
$oIE2 = _IECreate($sSrc)

Then now u can get the objects and set values accordingly.

Good luck!

;)

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  

×