HTTP Request: strip out html tags / get text that browser would show

S

Simon

Hi

We have an application that needs to just get the text that you would 'see'
when you open a webpage in Internet Explorer with no code.

Is it possible to strip out the html tags from the result of such code as
below.

Thanks in advance

B

Dim strURL As String

Dim strResult As String

Dim wbrq As HttpWebRequest

Dim wbrs As HttpWebResponse

Dim sr As StreamReader

' Set the URL (and add any querystring values)

strURL = "the page"

' Create the web request

wbrq = WebRequest.Create(strURL)

wbrq.Method = "GET"

' Read the returned data

wbrs = wbrq.GetResponse

sr = New StreamReader(wbrs.GetResponseStream)

strResult = sr.ReadToEnd.Trim

sr.Close()

' Write the returned data out to the page

TextBox1.Text = strResult
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top