|
Sub test()
Dim Url$, Str$, N&, I&, R&
Url = "https://www.miit.gov.cn/api-gateway/jpaas-publish-server/front/page/build/unit?webId=b3eba6883f9240e2b51025f690afbae8&pageId=9ea2861509164481af6d712d569aacf3&parseType=bulidstatic&pageType=column&tagId=%E4%BF%A1%E6%81%AF%E5%88%97%E8%A1%A8&tplSetId=9a9a7b87a4444169bdef99ff1f84e1aa&unitUrl=%2Fapi-gateway%2Fjpaas-publish-server%2Ffront%2Fpage%2Fbuild%2Funit¶mJson=%7B%22pageNo%22%3A1%2C%22pageSize%22%3A1000%2C%22loadEnabled%22%3Atrue%2C%22search%22%3A%22%7B%5C%22title%5C%22%3A%5C%22%5C%22%2C%5C%22PICI%5C%22%3A%5C%22339%5C%22%2C%5C%22CPMC%5C%22%3A%5C%22%5C%22%2C%5C%22QYMC%5C%22%3A%5C%22%5C%22%2C%5C%22CPXH%5C%22%3A%5C%22%5C%22%2C%5C%22CPSB%5C%22%3A%5C%22%5C%22%7D%22%7D"
With CreateObject("msxml2.xmlhttp")
.Open "GET", Url, True
.send
While .readystate <> 4
DoEvents
Wend
Debug.Print .Status
If .Status = 200 Then
Str = .responsetext
With CreateObject("htmlfile")
.write "<script></script>"
With .parentwindow
.eval "var json=" & Str
Str = .eval("json.data.html")
With CreateObject("htmlfile")
.write "<html><head></head><body>" & Str & "</body></html>"
With .all.tags("table")(0)
For N = 0 To .Rows.Length - 1
For I = 0 To .Rows(N).Cells.Length - 1
Cells(N + 1, I + 1).Value = .Rows(N).Cells(I).innertext
Next I
Next N
End With
End With
End With
End With
End If
End With
End Sub |
|