VBScript可以';不要将innerhtml写入文件

VBScript可以';不要将innerhtml写入文件,vbscript,innerhtml,Vbscript,Innerhtml,只需尝试从此站点获取innerhtml并写入文本文件。我以前从未遇到过这个问题,我似乎无法解决它。innerhtml将完美地回显,只是实际上无法将其写入文本文件。获取“无效过程调用或参数”错误。这个脚本是超级基本的,但仍然会出错。。。尝试与其他URL交换,效果良好。此站点正在发生特定的事件。这只是一个简单的登录屏幕,仍然无法获取innerhtml。有什么想法吗 set ie = createobject("internetexplorer.application") Set objShell

只需尝试从此站点获取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 
set ie=createobject(“internetexplorer.application”)
设置objShell=CreateObject(“WScript.Shell”)
设置fso=CreateObject(“Scripting.FileSystemObject”)
filename=fso.GetParentFolderName(WScript.ScriptFullName)&“\InstaGC\u Dump.txt”
wscript.sleep 2000
可见=假
URL=”http://www.instagc.com" 
浏览网址
'==============================
'等待URL加载
ie.busy:wscript.sleep 100:loop时执行
当IE忙时:Wscript.Sleep 100:Wend
而IE.ReadyState 4:Wscript.Sleep 100:Wend
而IE.document.readystate“完成”:wscript.sleep 100:Wend
wscript.sleep 2000“安全的额外睡眠”
'==============================
pageText=ie.document.body.innerhtml
设置ts=fso.opentextfile(文件名,2,true)
写页面文本
关闭

蒂亚

尝试以Unicode
set ts=fso.opentextfile(filename,2,true,-1)的形式打开文本文件。
。你真是个天才。作品我从没听说过这个。你能解释一下为什么会这样吗?此外,没有看到将注释标记为解决方案的选项。包含unicode字符的字符串无法正确保存到ASCII文本文件中,因此会发生错误。阅读