经典ASP中的Web抓取 [英] Web scraping in classic asp

查看:40
本文介绍了经典ASP中的Web抓取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用经典的ASP抓取网页.为什么,因为我有一个要包含在2个域中的asp文件,而我不想更新2个副本.

I'm trying to scrape a web page using classic asp. Why, because I have an asp file that I am trying to include in 2 domains and I'd rather not have 2 copies to update.

我对整个Web抓取工具还是陌生的,并且很难找到有关如何使用经典asp(不是我的喜好,而是我坚持的东西)的傻瓜"教程.我不需要任何花哨的东西,只需从here.asp抓取整个页面源并将其发布在myotherpage.asp上即可.

I'm new to the whole web scraping thing and having difficulty finding a "Dummies" tutorial on how to do it with classic asp (not my preference but what I'm stuck with). I don't need anything fancy, just a grab entire source of page from here.asp and post it on myotherpage.asp.

在代码或教程中几乎没有帮助,将不胜感激.

Little help in either code or tutorials would be appreciated.

推荐答案

要从Classic ASP中的URL检索HTML源,可以使用如下代码:

To retrieve the HTML source from a URL in Classic ASP you can use code like this:

<% 
Set obj = CreateObject("MSXML2.ServerXMLHTTP")
obj.Open "GET", "http://www.example.com/page.html", False
obj.Send ""
Response.Write obj.ResponseText
Set obj = Nothing 
%>

在此示例中,obj.ResponseText是HTML源.

In this example, obj.ResponseText is the HTML source.

这篇关于经典ASP中的Web抓取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆