3
夥計們。這是一個VBS腳本,可打開Google,填寫表單並單擊搜索按鈕。在VBScript中捕捉事件
set ie = CreateObject("InternetExplorer.Application")
ie.navigate("www.google.com")
ie.visible = true
while ie.readystate <> 4
wscript.sleep 100
WEnd
set fields = ie.document.getelementsbyname("q")
set buttons = ie.document.getelementsbyname("btnG")
fields(0).value = "some query"
buttons(0).click
ie.quit
Sub OnClickSub()
MsgBox "button clicked!", 0
End Sub
顯然,buttons(0).click
觸發按鈕,這是我需要以某種方式在我的腳本來捕獲,像推出OnClickSub()
它提供了一些處理的onclick事件。
有沒有人有任何想法應該如何做?
我不認爲可以將VBS函數/子附加到網頁中按鈕的單擊事件上,我相信您可以做的最好的是調用任何附加到該按鈕的點擊。 – Nate 2010-03-19 17:26:10