2016-01-30 82 views
0

這裏是我的代碼:等待一個按鈕加載VBSCRIPT

'What do i put here to wait until V that down there exists before continuing? 

ie.Document.getElementById(":zv.gt").Click 

'Do While ie.Busy Or ie.ReadyState <> 4: WScript.Sleep 5000: Loop <---- Wont work because the button doesnt actually popup until after the Page is already finished loading. 

什麼我把擁有它不斷地檢查,看看是否在繼續之前存在的按鈕?

回答

0

這似乎已經成功了。 Thx反正StackOverflow。

'Waits for button to load and clicks the button once loaded 
    '---------------------------------------------------------------------- 
    Do 
     On Error Resume Next 
     set x = ie.Document.getElementById(":zv.Ss") 
     If x is nothing then 
      wscript.sleep 200 
     else  
      ie.Document.getElementById(":zv.Ss").click 
     Exit Do 
     end if 
     On Error Goto 0 
    Loop