민서네집

[Autohotkey] 네이버 자동로그인 스크립트 본문

Autohotkey

[Autohotkey] 네이버 자동로그인 스크립트

브라이언7 2017. 11. 8. 00:41

http://www.autohotkey.co.kr/cgi/board.php?bo_table=qna&wr_id=44764


;#[출처] http://www.autohotkey.co.kr/cgi/board.php?bo_table=qna&wr_id=44764


#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.

; #Warn  ; Enable warnings to assist with detecting common errors.

SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.

SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.


#SingleInstance Off 


Gui, Add, Edit, x22 y20 w110 h20 vID, 아이디 

Gui, Add, Edit, x22 y50 w110 h20 vPW, 패스워드 

Gui, Add, Button, x22 y100 w100 h30 gLogin, 로그인

Gui, Show, x127 y87 h152 w166, Edit Box Test 


OnMessage(0x201, "WM_LBUTTONDOWN") 

Return


WM_LBUTTONDOWN(wParam, lParam) ; Thanks to Jackie Sztuk _Blackholyman - https://autohotkey.com/board/topic/86639-clear-edit-box-on-click/?p=551360 

  if (A_GuiControl = "ID" || A_GuiControl = "PW") 

GuiControl,,% A_GuiControl, 


Login: 

Gui, Submit, NoHide

pwb:=  ComObjCreate( "InternetExplorer.Application" ) 

pwb.navigate( "https://nid.naver.com/nidlogin.login" )        

pwb.Visible  :=  True 

Sleep, 1000 

;MsgBox %ID%

pwb.document.getElementById( "id" ).value := ID ; <---여기에 변수입력을 하고싶어요.

pwb.document.getElementById( "pw" ).value := PW ; <---여기에 변수입력을 하고싶어요.

pwb.document.getElementById("frmNIDLogin").submit()

Return 


GuiClose: 

ExitApp



[참고]

http://joyfui.wo.tc/582


Gui, Submit, NoHide 를 해줘야지 Edit 컨트롤의 변수값에 현재 Edit 컨트롤에 있는 내용이 할당된다.


ID, PW 변수값을 웹브라우저에 입력할 때 % 없이 적어야 하는 것도 중요!


Clear Edit Box on Click



Comments