2016-01-30 59 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