Created
January 6, 2012 00:48
-
-
Save mlhaufe/1568244 to your computer and use it in GitHub Desktop.
Getting html details (VBScript)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Reference: <http://www.visualbasicscript.com/tm.aspx?high=&m=95638&mpage=1> | |
Option Explicit | |
Dim fso : Set fso = CreateObject("Scripting.FileSystemObject") | |
Dim files : Set files = fso.GetFolder("C:\test\").Files | |
Dim file | |
For Each file In files | |
If file.Type = "Firefox Document" Then '<-- update for your system | |
Dim doc : Set doc = CreateObject("htmlfile") | |
doc.write fso.OpenTextFile(file.Path).ReadAll() | |
WScript.Echo doc.title | |
doc.title = doc.title & " (Modified)" | |
WScript.Echo doc.documentElement.outerHTML | |
End If | |
Next |
@iisboy I believe "htmlfile" is equivalent to Internet Explorer 6, and therefore supports ECMAScript version 3. Which means no JSON object.
Perhaps using a 3rd party library would help?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks for your reply. i want help for you a copy of code ,i test in windows 7 have a little bug,this is below:
`dim strJson,myJson
strJson="{ ""access_token"":""ACCESS_TOKEN"", ""expires_in"":7200, ""refresh_token"":""REFRESH_TOKEN"", ""openid"":""OPENID"", ""scope"":""SCOPE"" }"
set doc = CreateObject("htmlfile")
doc.write ""
set JSON = doc.frames.JSON
set obj = JSON.parse(strJson)
'myJson=JSON.stringify(obj)
Response.Write obj.access_token
retrun value :
Microsoft VBScript ����ʱ���� ���� '800a01b6'
����֧�ִ����Ի�: 'doc.frames.JSON'
/123_fun/1.asp���� 13`