Results 1 to 2 of 2

Thread: simple question

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Boston, MA
    Posts
    391

    simple question

    I'm building an ASP.NET app that needs to be able to retrieve an html document from a specified http address. I don't want to display the html anywhere, I just want to parse it so I can retrieve some information from it.

    Here's an example. Let's say that the information that I want to extract from an html page resides at "weather.com" . How can assign a variable to the contents of the html page contained at weather.com?

    My problem is that I can't figure out how to retreive the html document for processing. I would think that it's pretty simple, but I can't find a way to do it. Any direct help or links is greatly appreciated.

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Code:
    using System.Text;
    using System.Net;
    
    WebClient wc = new WebClient();
    PageData.Text = UTF8Encoding.UTF8.GetString(wc.DownloadData("http://www.vbforums.com"));

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width