Web scraping in classic asp [closed]

ⅰ亾dé卋堺 提交于 2020-07-24 05:29:22

问题


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.

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.


回答1:


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 
%>

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



来源:https://stackoverflow.com/questions/42700013/web-scraping-in-classic-asp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!