IEGet( name="" )
{
IfEqual, Name,, WinGetTitle, Name, ahk_class IEFrame ; Get active window if no parameter
Name := ( Name="New Tab - Windows Internet Explorer" ) ? "about:Tabs" : RegExReplace( Name, " - (Windows|Microsoft) Internet Explorer" )
For pwb in ComObjCreate( "Shell.Application" ).Windows
If ( pwb.LocationName = Name ) && InStr( pwb.FullName, "iexplore.exe" )
Return pwb
}
; 루프문을 돌리는 이유는 해당 페이지가 열려서 페이지의 내용 일부분이 일치할때까지 돌리기 위함.
;
A2=창이름
loop
{
sleep, 1000
pwb := IEGet(A2)
pwb.Visible := True
;Sleep, 100
;frame := pwb.document.parentWindow
;test := frame.document.documentElement.innerText
;htm := frame.document.documentElement.innerHTML
;프레임 이름을 가져오기(;두종류 - topFrame, leftFrame, mainFrame)
frame := pwb.document.parentWindow.frames["leftFrame"]
test := frame.document.documentElement.innerText
htm := frame.document.documentElement.innerHTML
;Gui, Add, Text,, Please enter your name:
;Gui, Add, Edit, w600 h500, %htm%
;Gui, Show
;msgbox, 바보
ifinstring, htm, ZNGMWLIN00010T01
{
break
}
}
frame.document.getElementsByTagName("A")[4].click()