65.9K
CodeProject is changing. Read more.
Home

Parsing an HTML document by using a recursive function

emptyStarIconemptyStarIconemptyStarIconemptyStarIconemptyStarIcon

0/5 (0 vote)

Sep 19, 2011

CPOL
viewsIcon

11642

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.

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