高分:如何在程序中读取别的网站的网页的内容,只需要别的网站的html

sjjf 2003-10-16 11:19:38
如何在程序中读取别的网站的网页的内容,只需要别的网站的html中的文字,不要图片等。
例如;我想获取今天新浪的新闻,稍微处理后再显示,在我的程序中处理,
该怎么做?请教各位高手!
...全文
73 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
luok 2003-10-16
  • 打赏
  • 举报
回复
是啊,搜一下就是了。很多的
say1no2 2003-10-16
  • 打赏
  • 举报
回复
用xmlhttp,网上有新闻小偷程序可以下载一个研究一下!
pp4u 2003-10-16
  • 打赏
  • 举报
回复
例如:
我们在编写ASP代码的时候,大家都知道可以通过post或者get获得form表单的数据,那么我们如何直接获得其他页面上的数据呢?这就要借助xmlhttp协议了。xmlhttp是xmldom技术的一部分。

下面的代码就是一个很简单的例子,我们利用xmlhttp技术,把http://www.codetoad.com/站点首页的代码以xml的形式完全获取,并且在页面中输出。

<%
Dim objXMLHTTP, xml
Set xml = Server.CreateObject("Microsoft.XMLHTTP")

xml.Open "GET", "http://www.codetoad.com/", False
' Pull the data from the web page
xml.Send

Response.write "Here's the html we now have in our xml object"
Response.write "<BR><BR><BR>"
Response.Write "<xmp>"
Response.Write xml.responseText
Response.Write "</xmp>"
Response.write "<BR><BR><BR>"
Response.write " Now here's how the page looks:<BR><BR>"
Response.Write xml.responseText

Set xml = Nothing
%>


详细参见:
http://www.csdn.net/develop/read_article.asp?id=17862
angelheavens 2003-10-16
  • 打赏
  • 举报
回复
<form onSubmit="location.href = 'view-source:' + location; return false;">
<input type="submit" value="查看源代码!">

把location改成你想看的网站地址可以了
pp4u 2003-10-16
  • 打赏
  • 举报
回复
用xmlhttp来读取
lp1983 2003-10-16
  • 打赏
  • 举报
回复
使用xmlhttp吧
你可以下载一个新闻小偷看看

28,391

社区成员

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

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