/ Published in: VB.NET
If you need to get the HTML from a Web page to rip it, process it, and/or display it in the way you want, the following function will work for you.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Public Function GetHTML(ByVal sURL As String, ByVal e As Integer) As String Dim oHttpWebRequest As System.Net.HttpWebRequest Dim oStream As System.IO.Stream Dim sChunk As String oHttpWebRequest = (System.Net.HttpWebRequest.Create(sURL)) Dim oHttpWebResponse As System.Net.WebResponse = oHttpWebRequest.GetResponse() oStream = oHttpWebResponse.GetResponseStream sChunk = New System.IO.StreamReader(oStream).ReadToEnd() If e = 0 Then Return Server.HtmlEncode(sChunk) Else Return Server.HtmlDecode(sChunk) End If End Function
URL: http://codefinds.blogspot.com/2009/01/return-html-from-web-page.html