怎样实现一个类似新闻小偷的程序?

ekeen 2003-12-19 09:04:45
假如www.demo.com是一个房产公司网站,上有一个搜索功能,可以找到本地一些房子的信息。我在自己网站做一个表单,当使用搜索的时候,使用www.demo.com网站的搜索功能,但让别人感觉是在我自己网站上搜索一样,要滤掉www.demo.com网站返回的一些信息。怎么做?谢谢!
...全文
48 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
ekeen 2003-12-23
  • 打赏
  • 举报
回复
找出了问题:
我用的是英文win2003操作系统。在中文操作系统下没有问题:)
全息宇宙 2003-12-22
  • 打赏
  • 举报
回复
给你一个偷取搜索的例子看看:
www.cn-grease.com/zip/wyc/test.rar
全息宇宙 2003-12-22
  • 打赏
  • 举报
回复
经测试,这句没问题啊!

strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
全息宇宙 2003-12-22
  • 打赏
  • 举报
回复
改成这样试试:

strReturn = strReturn & ChrW(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
全息宇宙 2003-12-20
  • 打赏
  • 举报
回复
http://expert.csdn.net/Expert/topic/2477/2477354.xml?temp=2.300662E-02
全息宇宙 2003-12-20
  • 打赏
  • 举报
回复
典型的新闻小偷程序,呵呵

晕:http://www.demo.com 怎么进不去

上面的代码有很多垃圾,这才是主要的:
<%
function getHTTPPage(url)
on error resume next
dim http
set http=Server.createobject("Microsoft.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytes2BSTR(Http.responseBody)
set http=nothing
if err.number<>0 then err.Clear
end function

Function bytes2BSTR(vIn)
dim strReturn
dim i,ThisCharCode,NextCharCode
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = strReturn
End Function

Function NewString(wstr,strng)
NewString=Instr(wstr,strng)
End Function
%>
ekeen 2003-12-20
  • 打赏
  • 举报
回复
对中文的页面有这个问题,英文就没有!:(
对中文:strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode)),
(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))这个值很大,有5000多,估计是要出错了!怎么回事?
看别人都用成功了!
郁闷!

ekeen 2003-12-20
  • 打赏
  • 举报
回复
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
这句报错.
______________________________
Microsoft VBScript runtime error '800a0005'

Invalid procedure call or argument: 'Chr'

/test/test.asp, line 46
__________________________________
怎么回事?
<body leftmargin="0" topmargin="0">
<%
on error resume next
Server.ScriptTimeOut=120
url = "http://product.zol.com.cn/soft/" '新闻来源的页面

wstr = getHTTPPage(url) '取得页面内容
if err.number=0 then
start=newstring(wstr," <table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0""><!-- t {{{ -->")
over=newstring(wstr,"<!-- 第一表结束 }}} -->")
wstr=mid(wstr,start,over-start-61)
wstr=replace(wstr,"<img src=""images/mid.gif""","<img src=""http://product.zol.com.cn/soft/images/mid.gif""")
wstr=replace(wstr,"background=""images/bg.gif""","background=""http://product.zol.com.cn/soft/images/bg.gif""")
end if
response.write wstr
%>
<%
function getHTTPPage(url)
on error resume next
dim http
set http=Server.createobject("Microsoft.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytes2BSTR(Http.responseBody)
set http=nothing
if err.number<>0 then err.Clear
end function

Function bytes2BSTR(vIn)
dim strReturn
dim i,ThisCharCode,NextCharCode
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = strReturn
End Function

Function newstring(wstr,strng)
newstring=Instr(wstr,strng)
End Function

Function LeftNews(strng,NewsLength,NeedTime)
If NeedTime<>True then
Left_0=Instr(strng,"</a>")+3
TheRed=Instr(strng,"<font color=#ff0000>")
If TheRed>0 then
Left_1=Instr(strng,"<font color=#ff0000>")+20
Left_2=Instr(strng,"</font>")
If Left_1+NewsLength>=Left_2 then
LeftNews=Left(strng,Left_0)
Else
LeftNews=Left(strng,Left_1+NewsLength)&Points&"</font></a>"
End if
Else
Left_1=Instr(strng,"_blank>")+7
Left_2=Instr(strng,"</a>")
If Left_1+NewsLength>=Left_2 then
LeftNews=Left(strng,Left_0)
Else
LeftNews=Left(strng,Left_1+NewsLength)&Points&"</a>"
End if
End if
Else
LeftNews=strng
End if
End Function

Function NewString(wstr,strng)
NewString=Instr(wstr,strng)
End Function

Function NumDate()
NumDate=Year(Date())&AddZero(Month(Date()),2)&AddZero(Day(Date()),2)
End Function

Function FormatDate(theDate,n)
FormatDate=Year(theDate)&n&AddZero(Month(theDate),2)&n&AddZero(Day(theDate),2)
End Function

Function AddZero(m,n) '添加0
If Len(m)<n then
AddZero=string(n-Len(m),"0")&m
Else
AddZero=m
End if
End function

Function LL(strng)
LL=Left(strng,Instr(strng,"</a>")+3)
End function

Erase ArrayNewsImg
Erase ArrayNewsTitle
%>

http://expert.csdn.net/Expert/topic/2477/2477354.xml?temp=2.300662E-02
by manyou(他山之石)


ekeen 2003-12-20
  • 打赏
  • 举报
回复
怎么我的err.number是不等于0?
if err.number=0 then
start=newstring(wstr," <table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0""><!-- t {{{ -->")
over=newstring(wstr,"<!-- 第一表结束 }}} -->")
wstr=mid(wstr,start,over-start-61)
wstr=replace(wstr,"<img src=""images/mid.gif""","<img src=""http://product.zol.com.cn/soft/images/mid.gif""")
wstr=replace(wstr,"background=""images/bg.gif""","background=""http://product.zol.com.cn/soft/images/bg.gif""")
end if
if err.number<>0 then
Response.Write "this is a error"
end if
______________________________________________________________________
输出的是:
this is a error
我了上面的关键函数写的!:(
url也肯定是能访问到!
tianjy 2003-12-20
  • 打赏
  • 举报
回复
up
talent303 2003-12-19
  • 打赏
  • 举报
回复
ding
lsaturn 2003-12-19
  • 打赏
  • 举报
回复
关注!
bzscs 2003-12-19
  • 打赏
  • 举报
回复
搜索“httpxml”,关键函数:
function getHTTPPage(url)
on error resume next
dim http
set http=Server.createobject("Msxml2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then exit function
getHTTPPage=bytes2BSTR(Http.responseBody)
set http=nothing
if err.number<>0 then err.Clear
end function

Function bytes2BSTR(vIn)
dim strReturn
dim i,ThisCharCode,NextCharCode
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = strReturn
End Function
本课程以2021年度大数据技术学习为背景,重点围绕Spark 3.0框架展开系统讲解。课程内容基于2020年9月官方正式发布的稳定版本Spark 3.0.1进行设计,确保所学技术紧跟行业前沿。整个教学体系划分为九个核心模块,涵盖从基础到高级的完整知识路径。 首先从Spark集群环境部署与配置入手,奠定实际操作基础。随后深入剖析Spark Core核心原理与编程模型,掌握分布式计算基础。课程进一步延伸至实时数据处理领域,系统讲解Spark Streaming流式计算框架及其应用场景。 在数据查询与分析部分,重点介绍Spark SQL模块,学习结构化数据处理方法。同时结合Structured Streaming技术,探讨现代流批一体架构的实现方式。通过综合实战案例,演示如何将各模块知识融会贯通,解决复杂业务场景中的数据处理问题。 为适应多样化开发需求,课程专门设置多语言编程章节,展示Scala、Python、Java等不同语言在Spark生态中的开发模式。针对Spark 3.0版本革新,详细解读其在性能优化、API改进及功能增强方面的最新特性。最后部分聚焦系统性能调优方法论,包括资源配置、执行计划优化等进阶内容,全面提升分布式系统运维能力。 资源来源于网络分享,仅用于学习交流使用,请勿用于商业,如有侵权请联系我删除!
【GA-ELM预测】基于遗传算法优化极限学习机的单维时间序列预测研究(Matlab代码实现)内容概要:本文研究基于遗传算法(GA)优化极限学习机(ELM)的单维时间序列预测方法,提出了一种结合智能优化算法与快速学习模型的预测框架。通过遗传算法优化ELM的关键参数(如输入权重和偏置),克服传统ELM随机赋值带来的不稳定性和精度局限,提升模型泛化能力与预测准确性。文中以Matlab代码实现整个算法流程,涵盖数据预处理、模型训练、参数优化及结果可视化等环节,适用于风电、负荷、交通流等单变量时间序列的短期预测场景。; 适合人群:具备一定Matlab编程基础,熟悉基本机器学习模型(如神经网络)的高校研究生、科研人员及工程技术人员,尤其适合从事时间序列预测、智能算法优化等相关领域的研究人员; 使用场景及目标:①解决传统ELM模型因随机初始化导致的性能波动问题;②实现高精度单变量时间序列预测,应用于能源、交通、金融等领域;③为智能优化算法与浅层神经网络结合提供可复现的技术方案; 阅读建议:建议读者结合提供的Matlab代码进行实践操作,重点关注遗传算法的编码方式、适应度函数设计以及ELM参数优化过程,通过调整种群规模、交叉变异概率等参数深入理解算法性能影响机制,并尝试将其迁移至其他预测任务中验证有效性。

28,407

社区成员

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

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