Click here to Skip to main content
Click here to Skip to main content
Alternative Tip

Parsing an HTML document by using a recursive function

, 19 Sep 2011
Rate this:
Please Sign up or sign in to vote.
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

License

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

Share

About the Author

marc9889
Software Developer (Senior) Jacobs Technology
United States United States
No Biography provided

Comments and Discussions

 
GeneralShouldn't this be a message, and not an alternate? PinsubeditorIndivara3-May-11 12:34 
Shouldn't this be a message, and not an alternate?
GeneralRe: Agreed it should be ;P PinmemberEdMan1964-May-11 9:37 

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

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

| Advertise | Privacy | Mobile
Web04 | 2.8.140827.1 | Last Updated 19 Sep 2011
Article Copyright 2011 by marc9889
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid