Not Implemented 501错误

edisonli 2005-03-31 10:39:44
我用XMLHTTP抓取网页,在本机调试没有问题,上传到服务器就提示Not Implemented,我查过错误是501错误,还有就是抓取其他网页都没有问题只是抓取比如:http://www.chengdu.gov.cn/citizen/warning/tindian.jsp?ClassID=02020106这样的在http://www.chengdu.gov.cn/顶级域名下的有问题,而像:http://egov.chengdu.gov.cn/index.jsp这样的在http://egov.chengdu.gov.cn二级域名下的就没有问题。

高手帮忙
...全文
377 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
edisonli 2005-03-31
  • 打赏
  • 举报
回复
代码如下:
<%
On Error Resume Next
Server.ScriptTimeOut=9999999
Dim wstr

Function getHTTPPage(Path)
t = GetBody(Path)
getHTTPPage=BytesToBstr(t,"GB2312")
End function

Function GetBody(url)
on error resume next
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", url, False, "", ""
.Send
GetBody = .ResponseBody
End With
Set Retrieval = Nothing
End Function


Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
Function Newstring(wstr,strng)
Newstring=Instr(lcase(wstr),lcase(strng))
if Newstring<=0 then Newstring=Len(wstr)
End Function

wstr=getHTTPPage("http://www.chengdu.gov.cn/citizen/warning/tindian.jsp?ClassID=02020106")

response.write wstr
%>

28,405

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧