等到IE加载每个标签vbscript

时间:2015-05-06 14:40:34

标签: c# vba internet-explorer vbscript

我一直在尝试制作一个等待直到我用Internet Explorer打开的每个标签都已加载的vbscript。但是,出于某种原因,它只会等到我打开的最后一个网页完成加载。 这是我的代码:

Set objExplorer = CreateObject("InternetExplorer.Application")
WebSite = "https://www.google.com"
with objExplorer
.Navigate2 WebSite
.AddressBar = 1
.Visible = 1
.ToolBar = 1
.StatusBar = 1
end with


WebSite = "http://www.intel.com"
with objExplorer
.Navigate2 WebSite, &h800
.AddressBar = 1
.Visible = 1
.ToolBar = 1
.StatusBar = 1
end with


WebSite = "http://www.theverge.com"
with objExplorer
.Navigate2 WebSite, &h800
.AddressBar = 1
.Visible = 1
.ToolBar = 1
.StatusBar = 1
end with

Do While objExplorer.ReadyState <> 4 Or objExplorer.Busy
    WScript.Sleep 10
Loop

Do While objExplorer.Document.ReadyState <> "complete"
    WScript.Sleep 10
Loop

我加载了大约7个网页,每个网页都在不同的标签中。 作为奖励,是否可以在C#上执行此操作? 谢谢!

0 个答案:

没有答案