怎么把别的网站的信息读取过来?

KakerLau 2009-11-23 10:01:25
像这个:http://forex.jrj.com.cn/

这个外汇报价怎么放到我的网站上?这个外汇报价是实时更新的。
...全文
147 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
KakerLau 2009-11-24
  • 打赏
  • 举报
回复
测试了一下!可以了!谢谢啊!
挨踢直男 2009-11-23
  • 打赏
  • 举报
回复
<iframe src="http://forex.jrj.com.cn/" width="100%" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>
nethp 2009-11-23
  • 打赏
  • 举报
回复
asp 小偷程序
ayouori 2009-11-23
  • 打赏
  • 举报
回复
提取table,试了一下可以的,

<title>test</title>
<style>
td{background:#ffffff;width:65px;text-align:center;color:#ff3300;font-size:12px;};
th{background:#dddddd;width:65px;height:24px;text-align:center;color:#555555;font-size:12px;};
</style>
<%
Function GetHtmlCode(url)
Dim HtmlStr
Set HtmlStr = Server.CreateObject("MSXML2.serverXMLHTTP")
HtmlStr.Open "GET",url,False,"",""
HtmlStr.Send
While HtmlStr.readyState <> 4
HtmlStr.waitForResponse 1000
Wend
GetHtmlCode = BytesToBstr(HtmlStr.responseBody,"gb2312")
Set HtmlStr = 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

public function findBt(StrMain,StrBegin,StrEnd)
Dim num1,num2,numLen1,numLen2
numLen1 = len(StrBegin)
numLen2 = len(StrEnd)
num1 = InStr(StrMain,StrBegin) + numLen1
num2 = InStr(StrMain,StrEnd) - num1
FindBt = Mid(StrMain,num1,num2)
end function
dim str1,str
str1 = GetHtmlCode("http://forex.jrj.com.cn/list/whbjList.shtml")
str1 = findBt(str1,"<table class=""t3 tfix"">","</table>")
str1 = replace(str1," ","")
str1 = replace(str1," "," ")
str = replace(str1," class=""bd2""","")
str = replace(str,"<a ","<span ")
str = replace(str,"</a>","</span>")
%>
<center>
<textarea style="width:990px;height:200px;">
更改后table代码:
<table><%=str%></table>
</textarea>
<table cellspacing="1" cellpadding="0" border="0" bgcolor="#999999"><%=str%></table>
ayouori 2009-11-23
  • 打赏
  • 举报
回复
点那个网站上的更多,能进入http://forex.jrj.com.cn/list/whbjList.shtml这个页面,
这个内容很少,只有一个table,代码特征很好找,
可以写一个asp页面,用代码读取这个页的内容为一个字符串,
从字符串中取<table class="t3 tfix">到</table>这一段内容,直接引用就是一个完整的表格,
可以把<table class="t3 tfix">和<td>replace成加了自己写的css的标签,就成了自已设计的样式,
也可以通过<tr><td><th>等标签特征,把其中数据读进数组再调用,
每次运行该asp页面时取数据.
chong6 2009-11-23
  • 打赏
  • 举报
回复
我也想知道如何弄!
daileihaha 2009-11-23
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 aspwebchh 的回复:]
<iframe src="http://forex.jrj.com.cn/" width="100%"  marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"> </iframe>
[/Quote]
这个比较好,省事,不过也可以时时抓取它里面数据,放到到你自己数据库里,它更新了。。。你把更新的数据显示出来就可以了。
挨踢直男 2009-11-23
  • 打赏
  • 举报
回复
把坐标调一下啊
lzp4881 2009-11-23
  • 打赏
  • 举报
回复
用小偷程序抓取
KakerLau 2009-11-23
  • 打赏
  • 举报
回复
楼上我问的是某部分引用过来,不是整个网页

28,406

社区成员

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

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