Auto Login into Website and get Data!

Post your working scripts, libraries and tools
User
Posts: 407
Joined: 26 Jun 2017, 08:12

Auto Login into Website and get Data!

18 Oct 2018, 22:05

Someone asked me for this and I managed to use the workaround below (Better alternatives are welcomed):

The script just shows the user language option from Autohotkey forum!

Code: Select all

	;this script shows user language option from Autohotkey forum!

Loginname := "user name here"
Password := "password here"
URL := "https://autohotkey.com/boards/ucp.php?i=ucp_prefs&mode=personal"

WB := ComObjCreate("InternetExplorer.Application")

WB.Visible := true

WB.Navigate(URL)
;wait for the page to load
While wb.readyState != 4 || wb.document.readyState != "complete" || wb.busy 
Sleep, 500

wb.document.getElementById("username").value := Loginname
wb.document.getElementById("password").value := Password

wb.document.querySelector(".button1[name='login']").click()	;"." means "Class" (click the element in which class = "button1")
;wait for the page to load
While wb.readyState != 4 || wb.document.readyState != "complete" || wb.busy
Sleep, 500

Msgbox, % "lang = " wb.document.querySelector("#lang > option:nth-child(1)").innertext

WB.Quit()

return

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 41 guests