Set xm = CreateObject("Msxml2.XMLHTTP.3.0")
xm.Open "GET", "http://zst.aicai.com/gaopin_11ydj", False
xm.send
s = StrConv(xm.responsebody, vbUnicode)
【如果中文转换有乱码,要调用下面函数,并将上一句改为
s =BytesToBstr(xm.responsebody)】
Function BytesToBstr(body)
Dim objstream
Set objstream = CreateObject("adodb.stream")
With objstream
.Type = 1
.Mode = 3
.Open
.Write body
.Position = 0
.Type = 2
.Charset = "UTF-8" '如果有乱码,手动打开网页源代码,看是什么编码的,修改成GB2312试试
BytesToBstr = objstream.ReadText
.Close
End With
Set objstream = Nothing
End Function
联系客服