Sub TEST()
Url = "http://mops.twse.com.tw/nas/t21/sii/t21sc03_107_4_0.html"
Set HTML = CreateObject("Microsoft.XMLHTTP")
With HTML
.Open "GET", Url, False
.setRequestHeader "pragma", "no-cache"
.setRequestHeader "cache-control", "no-store, must-revalidate, private"
.setRequestHeader "charset", "utf-8"
.send
End With
MsgBox convertraw(HTML.responsebody)
End Sub
Function convertraw(rawdata)
Dim rawstr
Set rawstr = CreateObject("adodb.stream")
With rawstr
.Type = 1
.Mode = 3
.Open
.Write rawdata
.Position = 0
.Type = 2
.Charset = "big5"
convertraw = .ReadText
.Close
End With
Set rawstr = Nothing