[vba] 웹 브라우저(Web browser) / InternetExplorer 를 이용한 네이버 검색

하나를하더라도최선을 2019-09-29 23:21:49 33,712 0 0



Dim IE As Object
Sub program1472_com()
    On Error GoTo ErrPass
    If IE Is Nothing Then _
    Set IE = CreateObject("InternetExplorer.Application")
    With IE
        If Not .Visible Then .Visible = True
        .Navigate2 "https://www.naver.com/"
        Do While .Busy = True Or .ReadyState <> 4
            DoEvents
        Loop
        Application.Wait Now + TimeValue("0:00:01")
        .document.all("query").Value = "http://program1472.com/"
        .document.all("search_btn").Click
        Do While .Busy = True Or .ReadyState <> 4
            DoEvents
        Loop
        Application.Wait Now + TimeValue("0:00:01")
        Debug.Print .LocationURL
    End With
    Exit Sub
ErrPass:
    Set IE = Nothing
    program1472_com
End Sub
 

댓글 0개

첫 번째 댓글을 작성해보세요!