There are no comments yet...Kick things off by filling out the form below.
Retrieve data from a web page : Mark Smith
An example of how we can make a request to a web page and retrieve the resulting HTML
Summary: An example of how we can make a request to a web page and retrieve the resulting HTML
There are a few situations where it would be useful to be able to retrieve the HTML from a web page via code. Fortunately, this is made relatively easy by the HttpWebRequest and httpWebResponse classes.
Firstly, we need to decide which type of form the web page is using. The two different methods are GET and POST and for this article, I'm going to assume you have a basic understanding of these methods and I'll simply show you an example of how to implement either method rather than go into the differences between them. For both methods we'll need a simple page to actually display the results so let's start by making a page with a TextBox on it....
