This is a first of a series of videos demonstrating how to use AutoHotkey to automate Logging into websites. In this first example I work with Hellbent (he has some great AutoHotkey GUI tutorial videos) to explain basics of Web scraping. During this video we walk through how to login to Facebook.
Here are links to the Iwb2 learner tool and my web scraping writing tools that I use in the video.
Login to Facebook Video
Login to Facebook AutoHotkey script
;************************************************************ pwb := ComObjCreate("InternetExplorer.Application") ;create IE Object pwb.visible:=True ; Set the IE object to visible pwb.Navigate("https://www.facebook.com/login.php") ;Navigate to URL while pwb.busy or pwb.ReadyState != 4 ;Wait for page to load Sleep, 100 if instr(pwb.locationURL,"login"){ pwb.document.all.email.Value :="[email protected]" ;Unique ID -no dashes pwb.document.all.pass.Value :="The_Stupidist_Password!" ;Unique ID -no dashes pwb.document.all.loginbutton.click() } ;************Pointer to Open IE Window****************** WBGet(WinTitle="ahk_class IEFrame", Svr#=1) { ;// based on ComObjQuery docs static msg := DllCall("RegisterWindowMessage", "str", "WM_HTML_GETOBJECT") , IID := "{0002DF05-0000-0000-C000-000000000046}" ;// IID_IWebBrowserApp ;// , IID := "{332C4427-26CB-11D0-B483-00C04FD90119}" ;// IID_IHTMLWindow2 SendMessage msg, 0, 0, Internet Explorer_Server%Svr#%, %WinTitle% if (ErrorLevel != "FAIL") { lResult:=ErrorLevel, VarSetCapacity(GUID,16,0) if DllCall("ole32\CLSIDFromString", "wstr","{332C4425-26CB-11D0-B483-00C04FD90119}", "ptr",&GUID) >= 0 { DllCall("oleacc\ObjectFromLresult", "ptr",lResult, "ptr",&GUID, "ptr",0, "ptr*",pdoc) return ComObj(9,ComObjQuery(pdoc,IID,IID),1), ObjRelease(pdoc) } } }