Jump to content

Auto Log-in WinHttp


AutID
 Share

Recommended Posts

Hello,

It is the second time I am running to this problem again. First time I used simple form fill function from winhttp.au3. And I added a sleep between logins to make it work but this solution sucks.
So I am wondering again, is there an other solution to perform a log in on website other than simple form fill?
I just want to check credentials so I need to perform log in and then check for the username in the results.

Here is an example with simple form fill

#include "WinHttp.au3"
Global $sRead, $hOpen, $hConnect
Global $sUsername, $sPassword, $sName
Global $sUrl = "https://www.facebook.com/"
Global $sUserAgent = "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)"
$hOpen = _WinHttpOpen($sUserAgent)
$hConnect = _WinHttpConnect($hOpen, $sUrl)
$sRead = _WinHttpSimpleFormFill($hConnect, _
  Default, _
  "login_form", _
  "name:email", $sUsername, _
  "name:pass", $sPassword)
If @error Then
 MsgBox(0, "Error", "Error: " & @error)
ElseIf StringInStr($sRead, $sName) = True Then
 MsgBox(0, "", $sName & "'s credentials are correct.")
Else
 MsgBox(0, "", "Wrong credentials, please try again.")
EndIf
_WinHttpCloseHandle($hConnect)
_WinHttpCloseHandle($hOpen)
Link to comment
Share on other sites

Hi AutID,

Auto website login is against forum rules!


Bypassing of security measures - log-in and security dialogs, CAPTCHAs, anti-bot agents, software activation, etc.

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

×
×
  • Create New...