VBScript无法将innerhtml写入文件

时间:2015-11-26 19:30:11

标签: vbscript innerhtml

只需尝试从此站点获取innerhtml并写入文本文件。我以前从来没有遇到过这个问题,我似乎无法解决这个问题。 innerhtml将完美回显,实际上无法将其写入文本文件。获取“无效的过程调用或参数”错误。这个脚本是超级基本的,但仍然会出错...尝试与其他URL交换并正常工作。这个网站特有的东西正在发生。它只是一个简单的登录屏幕,仍然无法获取innerhtml。有什么想法吗?

set ie = createobject("internetexplorer.application") 
Set objShell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")

filename = fso.GetParentFolderName(WScript.ScriptFullName) & "\InstaGC_Dump.txt"

wscript.sleep 2000

ie.Visible = false
URL = "http://www.instagc.com" 

ie.navigate URL

'==============================
'wait until URL loads

do while ie.busy: wscript.sleep 100: loop
While IE.Busy: Wscript.Sleep 100: Wend
While IE.ReadyState <> 4: Wscript.Sleep 100: Wend
While IE.document.readystate <> "complete": wscript.sleep 100: Wend
wscript.sleep 2000 'Extra sleep to be safe
'==============================

pageText = ie.document.body.innerhtml

set ts = fso.opentextfile(filename,2,true) 
ts.write pageText
ts.close 

TIA!

0 个答案:

没有答案
相关问题