动态网页不能静态获取了,需要模拟浏览器,用IE.app COM对象即可,但是此站点对IE的兼容太差了,右边内容Transactions无法显示;所以下载的网页页不全; 要想全面,去用selenium+chromeDriver模拟浏览器
给个IE.App的vbs脚本:
用法:vbs脚本名 url 保存.html- ' To fetch dynamic HTML document,and save to a file
- ' Usage: thisScript.vbs URL FilePathToSave
- Option Explicit
- Sub main()
- On Error Resume Next
- Dim objIE,objADO
- If WSH.Arguments.Count <> 2 Then Exit Sub
- Set objIE = WSH.CreateObject("InternetExplorer.Application", "evtIE_")
- Set objADO = CreateObject("ADODB.Stream")
- objIE.Visible = False
- objIE.Navigate2 WSH.Arguments(0)
- ShowError
- Do While objIE.ReadyState <> 4
- WSH.Sleep 10
- Loop
- With objADO
- .Mode = 3
- .Type = 2
- .Charset = objIE.document.charset
- .Open
- .WriteText objIE.document.documentElement.outerHTML
- .SetEOS
- .SaveToFile WSH.Arguments(1), 2
- .Close
- End With
- objIE.Quit
- ShowError
- Set objIE = Nothing
- Set objADO = Nothing
- End Sub
- Sub ShowError()
- If Err.Number <> 0 Then
- WSH.Echo "Err # " & Err.Number & vbNewLine & _
- "Description: " & Err.Description & vbnewline & _
- "Source: " & Err.Source
- Err.Clear
- End If
- End Sub
-
- main
复制代码
|