Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / web / HTML

Parsing an HTML document by using a recursive function

0.00/5 (No votes)
19 Sep 2011CPOL 11.6K  
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)