Click here to Skip to main content
15,884,388 members
Articles / Web Development / HTML
Alternative
Tip/Trick

Parsing an HTML document by using a recursive function

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
19 Sep 2011CPOL 11.2K   2
In response to the request to use a website (instead of a file), the pertinent code is shown below. Note that you will need to replace "www.somewebsite.com" with the website page that you want to capture the source code (HTML, for example) from.Dim webclient As System.Net.WebClient = New...

In response to the request to use a website (instead of a file), the pertinent code is shown below. Note that you will need to replace "www.somewebsite.com" with the website page that you want to capture the source code (HTML, for example) from.


VB
Dim webclient As System.Net.WebClient = New System.Net.WebClient
Dim url As String = "http://www.somewebsite.com"
Dim myHTML As String = webclient.DownloadString(url)

'Dim filePath As String = "C:\htmlsourcefile.txt"
'Dim myStreamReader = New System.IO.StreamReader(filePath)
'myHTML = myStreamReader.ReadToEnd

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Jacobs Technology
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralShouldn't this be a message, and not an alternate? Pin
Indivara3-May-11 12:34
professionalIndivara3-May-11 12:34 
GeneralRe: Agreed it should be ;P Pin
Ed Nutting4-May-11 9:37
Ed Nutting4-May-11 9:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.