嗨,我正在尝试将网站上的一些数据粘贴到txt中,是否可以在不覆盖文件的情况下粘贴到新行上?这是我的密码
Set app = CreateObject("Shell.Application")
For Each window In app.Windows()
If InStr(1, window.FullName, "iexplore", vbTextCompare) > 0 Then
Set ie = window
Exit For
End If
Next
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("output.txt", 2, True,utf-2)
f.Write ie.Document.All.Item("resltext").innerText
f.Close
发布于 2015-07-08 15:47:42
明白了
f.WriteLine ie.Document.All.Item("resltext").innerText
发布于 2015-07-02 16:44:30
来自opentextfile.asp,
看起来如果你改变了
Set f = fso.OpenTextFile("output.txt", 2, True,utf-2) 至
Set f = fso.OpenTextFile("output.txt", 8, True,utf-2) 它将附加到文件的末尾,而不是覆盖。
https://stackoverflow.com/questions/31190183
复制相似问题