我建議爲此目的使用另一種語言,例如Ruby非常擅長並且是VbScripters的自然升級。 這就是說,這裏是一個如何在VbScript中做到這一點的方法..
set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
with IE
.MenuBar = 0
.ToolBar = 0
.StatusBar = 0
.Visible = 1
.navigate "http://www.google.com"
end with
while IE.busy
wScript.sleep 400
wend
'html = IE.document.all.tags("html").item(0).outerhtml
wscript.echo IE.document.getElementsByTagName("font").item(0).innerText
wscript.echo "innerText:" & IE.document.all.tags("title").item(0).innerText
wscript.echo "innerHtml:" & IE.document.all.tags("title").item(0).innerHtml
wscript.echo "outerHtml:" & IE.document.all.tags("title").item(0).outerHtml
IE.quit
'gives
'Google.be aangeboden in: français Deutsch English
'innerText:Google
'innerHtml:Google
'outerHtml:<title>Google</title>