<%@ assembly name="system.net" %> <%@ import namespace="system.net" %> <%@ import namespace="system.io" %> <script language="vb" runat="server"> dim strtemp as string sub page_load(src as object, e as eventargs) dim httpwresp as httpwebresponse dim sr as streamreader 'dim strtemp as string dim build as new stringbuilder
httpwreq = webrequestfactory.create("http://www.funinspace.com") httpwreq.keepalive = false httpwresp = httpwreq.getresponse() sr = new streamreader(httpwresp.getresponsestream(), encoding.ascii)
do while not isnothing(line) line = sr.readline() lineenc = server.htmlencode(line) & vbcrlf & "<br>" build.append (lineenc) loop catch ex as exception problem.text =ex.message end try
labelscrape.text=build.tostring() end sub </script> <html><head> <title>scraping a website</title> </head> <body bgcolor="#ffffff"> <h3><font face="verdana">scraped data</font></h3> <asp:label id=problem runat="server"/>