Jump to content

Recommended Posts

Posted

I have 0.1 http knowledge. So my attempt to log in to Hotmail is this:

#include "WinHttp.au3"
;~ Local $sURL = "https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=12&ct=1417894769&rver=6.4.6456.0&wp=MBI_SSL_SHARED&wreply=https:%2F%2Fdub120.mail.live.com%2Fdefault.aspx%3Frru%3Dinbox&lc=2057&id=64855&mkt=en-gb&cbcxt=mai"
Local $sURL = "http://hotmail.com/"
Local $hOpen = _WinHttpOpen()
Local $hConnect = _WinHttpConnect($hOpen, $sURL)
Local $sResult = _WinHttpSimpleFormFill($hConnect, Default, _
        "f1", _
        "i0116", "email", _
        "i0118", "pass")
If @error Then
    ConsoleWrite("Error: " & @error & @LF)
    _WinHttpCloseHandle($hConnect)
    _WinHttpCloseHandle($hOpen)
Else
    _WinHttpCloseHandle($hConnect)
    _WinHttpCloseHandle($hOpen)
    ConsoleWrite($sResult & @CRLF)
EndIf

which fails.

Any http gurus to lend me a hand here?

 

  • Moderators
Posted

Unfortunately, I don't have that udf downloaded, nor do I have the time to play with it.

Maybe the redirect kills it.

Maybe it's case sensitive (don't know the func).

You've really not provided anything you've done to debug this, so here's my advice...Take the udf function, break it down into parts.

Use the html from live.com


<form method="post" name="f1" target="_top"><div class="section"><div style="display: none;" id="idTd_Tile_Error" aria-relevant="text" aria-live="assertive" aria-atomic="true"><div id="idTd_Tile_ErrorMsg_Login" class="errorDiv first"></div></div><div style="display: none;" id="idTd_PWD_Error" aria-relevant="text" aria-live="assertive" aria-atomic="true"><div id="idTd_PWD_ErrorMsg_Username" class="errorDiv first">Generic Password Error Message</div></div><div id="idTd_PWD_UsernameLbl" class="row label"><span id="idLbl_PWD_Username" role="heading">Microsoft account <a id="idA_MSAccLearnMore" href="http://go.microsoft.com/fwlink/?LinkID=254486" target="_blank">What's this?</a></span></div><div id="idDiv_PWD_UsernameTb" class="row textbox"><div style="width: 100%; position: relative;"><input id="i0116" lang="en" class="ltr_override" aria-labelledby="idLbl_PWD_Username" name="login" maxLength="113" type="email"><div style="left: 0px; top: 0px; width: 100%; position: absolute; z-index: 5;" class="phholder"><div aria-hidden="true" style="cursor: text;" id="idDiv_PWD_UsernameExample" class="placeholder ltr_override">someone@example.com</div></div></div></div><div style="display: none;" id="idTd_PWD_Error_Password" aria-relevant="text" aria-live="assertive" aria-atomic="true"><div id="idTd_PWD_ErrorMsg_Password" class="errorDiv"></div></div><div id="idDiv_PWD_PasswordTb" class="row textbox"><div style="width: 100%; position: relative;"><input id="i0118" aria-labelledby="idDiv_PWD_PasswordExample" name="passwd" type="password"><div style="left: 0px; top: 0px; width: 100%; position: absolute; z-index: 5;" class="phholder"><div aria-hidden="true" style="cursor: text;" id="idDiv_PWD_PasswordExample" class="placeholder">Password</div></div></div></div><div id="idTd_PWD_KMSI_Cb"><input id="idChkBx_PWD_KMSI0Pwd" name="KMSI" value="1" type="checkbox"><label id="idLbl_PWD_KMSI_Cb" for="idChkBx_PWD_KMSI0Pwd">Keep me signed in</label></div></div><div id="idTd_PWD_SubmitCancelTbl" class="section"><input id="idSIButton9" class="default" name="SI" value="Sign in" type="submit"></div><div class="section"><div id="idDiv_PWD_ForgotPassword" class="row small"><a id="idA_PWD_ForgotPassword" href="https://account.live.com/ResetPassword.aspx?wreply=https://login.live.com/login.srf%3fwa%3dwsignin1.0%26rpsnv%3d12%26ct%3d1417894769%26rver%3d6.4.6456.0%26wp%3dMBI_SSL_SHARED%26wreply%3dhttps:%252F%252Fdub120.mail.live.com%252Fdefault.aspx%253Frru%253Dinbox%26lc%3d2057%26id%3d64855%26mkt%3den-gb%26cbcxt%3dmai%26bk%3d1417971425&amp;id=64855&amp;uiflavor=web&amp;uaid=94e767c0d32240fb9e280a1ec6346e37&amp;mkt=EN-GB&amp;lc=2057&amp;bk=1417971425">Can't access your account?</a></div><div id="idTD_PWD_SwitchToOTCLink" class="row small"><a id="idA_PWD_SwitchToOTC" href="">Sign in with a single-use code</a></div></div></form>

 

To see if you can spot the issue.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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
×
×
  • Create New...