set objXmlHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
objXmlHttp.Open "GET", "http://www.yapi.com.tr/Haberler/e_61034.html", false
objXmlHttp.Send
response.write objXmlHttp.ResponseText这段代码并没有给我所有的源代码。Responsetext是直到"YapıDergisi,284“,但原始页面是直到"/body /html”。为什么这会发生在我身上?
原始页面- http://www.yapi.com.tr/Haberler/e_61034.html
我的代码- http://www.mekanturu.com/1.asp
发布于 2011-08-09 13:12:23
在原始页面中,在主文章的末尾(在“284”之后)似乎有一个空字节。看起来ResponseText将该空字节视为响应字符串的末尾。我能够通过使用以下内容获得全文:
<%
Response.CharSet = 65001
Response.AddHeader "Content-Type", "text/html;charset=UTF-8"
set objXmlHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
objXmlHttp.Open "GET", "http://www.yapi.com.tr/Haberler/e_61034.html", false
objXmlHttp.Send
Response.BinaryWrite objXmlHttp.ResponseBody
%>注意,我将响应字符集设置为UTF-8,这与原始页面匹配。
https://stackoverflow.com/questions/6971262
复制相似问题