2010. 3. 13. 09:09
IE Automation: VBScript 로 Google 검색하기
2010. 3. 13. 09:09 in 3. Implementation/VB / Java Script
아래 VB 코드는 Internet Explorer 를 실행한 후 "http://www.google.com" 구글페이지로 가서 검색하는 예이다. 확장자를 .vbs 로 저장한 후 실행하면 확인할 수 있다.
출처 : http://www.vbforums.com/showthread.php?t=512760
참고 : http://msdn.microsoft.com/en-us/magazine/cc337896.aspx
Search_Google Sub Search_Google() Dim IE Set IE = CreateObject("InternetExplorer.Application") IE.Navigate "http://www.google.com" 'load web page google.com While IE.Busy WScript.Sleep(100) 'wait until IE is done loading page. Wend IE.Document.getElementById("q").Value = "what you want to put in text box" ie.Document.all("btnG").Click 'clicks the button named "btng" which is google's "google search" button While ie.Busy WScript.Sleep(100) 'wait until IE is done loading page. Wend End Sub |
출처 : http://www.vbforums.com/showthread.php?t=512760
참고 : http://msdn.microsoft.com/en-us/magazine/cc337896.aspx