Results 1 to 3 of 3

Thread: [RESOLVED] [2005] Reading Web Page and Write to Text File

  1. #1

    Thread Starter
    Hyperactive Member rjbudz's Avatar
    Join Date
    Jul 2005
    Location
    San Diego
    Posts
    262

    Resolved [RESOLVED] [2005] Reading Web Page and Write to Text File

    I've seen this done before, without a webcontrol (browser) which is handy because some of the pages get load errors, which will prevent automated downloads.

    Here's what I'm trying to accomplish: For a series of web pages (several hundred, I think), download the source code for the page and store it onto a text file for later processing. This means I probably need to wait for the HTML source code to download prior to getting the next page.

    Each web page can be uniquely numbered based on its URL. It can be in either HTML or (preferably) just the text from the page.

    Isn't there a URLDownload function in .net? Can't seem to find it in the documentation or this forum. Help?

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: [2005] Reading Web Page and Write to Text File

    the WebClient has a DownloadString method:

    VB.Net Code:
    1. Dim wc As New Net.WebClient
    2.         Dim html As String = wc.DownloadString("www.google.com")
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3

    Thread Starter
    Hyperactive Member rjbudz's Avatar
    Join Date
    Jul 2005
    Location
    San Diego
    Posts
    262

    Re: [2005] Reading Web Page and Write to Text File

    Pretty easy when ya know the secret. Thank you. I do appreciate it.

    Is there a way (since that one was answered so easily) to do it with just the page's text (without the HTML?

    I feel like I'm asking for the moon now, but others may want to do this too (ok, it sounded good to me!)

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