How Can I Read a Web Page?

  • Thread starter Thread starter eBob.com
  • Start date Start date
E

eBob.com

I want to read a web page. That is, I have a URL and I want to read
the HTML and parse it and put the info into a data base. I've never
done any TCP/IP programming.

Thanks to a recent post here I am aware of the System.Web.*
namespaces, but I've looked through some of them and they all seem to
be server-side oriented. I need the kind of code used by the
client/browser side.

Thanks, Bob
 
eBob.com said:
I want to read a web page. That is, I have a URL and I want to read
the HTML and parse it and put the info into a data base. I've never
done any TCP/IP programming.

\\\
Imports System.IO
Imports System.Net
..
..
..
Public Function LoadTextFile(ByVal Url As String) As String
Dim wrq As WebRequest = WebRequest.Create(Url)
Dim wrp As HttpWebResponse = _
DirectCast(wrq.GetResponse(), HttpWebResponse)
Dim sr As New StreamReader(wrp.GetResponseStream)
Dim Text As String = sr.ReadToEnd()
sr.Close()
wrp.Close()
Return Text
End Function
///
 
BRAVO Mr. Wagner!

It is refreshing to see a straightforward and correct answer as opposed to
the "why didn't you Google" responses that only waste bandwidth.

Well done.

Jim Hubbard
 
As the OP I hope that Mr. Wagner realized the difficulty of coming up with
search arguments for this query. I always do searches before posting a
question if I can come up with reasonable search arguments. But, in this
case, I did not have to do a search to realize that "read web page" was
going to get me a huge number of hits, only a handful of which would be of
interest.

Bob
 
Although Google is promoted as the search engine King, I believe it is so
just because others have not tried Vivisimo yet.

Google is great at flooding you with a ton of results really fast. But,
sifting through all of those results to find something that meets your needs
can be time-consuming. It's like dumping a file folder full of related info
on the floor and having to look through the mess to find what you need.

Vivisimo groups results (they call it clustering - even have a beta site
called www.clusty.com the last time I looked) - try it and you'll see what I
mean.

Whenever I am overwhelmed by Google's info-glut, I go to www.Vivisimo.com to
sort things out.

(Note: No I do not work for or advertise on Vivisimo. I just think a great
solution deserves some air-time and people deserve choices.)

Jim Hubbard
 
Back
Top