By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,574 Members | 2,960 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,574 IT Pros & Developers. It's quick & easy.

Search for a value in an html page

P: n/a
Good Morning,

Does anyone have an example (in vb .net) of how I can bring down an internal
web html page into a string variable and then search for a specific string.
The web page is internal and does not need any user to access it.

Thanks.

Dale
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi,

This seems (beside mshtml what is difficult to use) to be the best for that.

http://sharptoolbox.com/Tool68a04d8d...a4f672a60.aspx

I hope this helps.

Cor
Nov 21 '05 #2

P: n/a
I believe you want to do this?

Imports System.Net
Imports System.IO

Module Module1

Sub Main()
Dim myHttpWebRequest As HttpWebRequest =
myHttpWebRequest.Create("http://www.google.com")
Dim myHttpWebResponse As HttpWebResponse =
myHttpWebRequest.GetResponse()
Dim myStream As Stream = myHttpWebResponse.GetResponseStream
Dim myStreamReader As New
StreamReader(myHttpWebResponse.GetResponseStream)
Debug.Write(myStreamReader.ReadToEnd)
End Sub

End Module

Nov 21 '05 #3

P: n/a
Broadened it out a bit...

Imports System.Net
Imports System.IO

Module Module1

Sub Main()
Dim myHttpWebRequest As HttpWebRequest =
myHttpWebRequest.Create("http://www.google.com")
Dim myHttpWebResponse As HttpWebResponse =
myHttpWebRequest.GetResponse()
Dim myStreamReader As New
StreamReader(myHttpWebResponse.GetResponseStream)
Dim sHTML As String = myStreamReader.ReadToEnd
Dim iIndex As Integer = sHTML.IndexOf("Froogle")
If iIndex > 0 Then
Debug.Write("value found")
Else
Debug.Write("value not found")
End If
End Sub

End Module

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.