Results 1 to 3 of 3

Thread: How do I catch a html-source?

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2000
    Location
    Denmark
    Posts
    44

    Question

    Hello!

    How do i retrieve a webpage-sourcecode from with a classmodule without using a hidden form?

    I think it's difficult to place a component in a class - can it be done some other weay??


    Kind regards
    Janus


  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Code:
    'using the inet control grab the source code of a web page
    Private Sub Command1_Click()
       
       Dim myFile As String
       myFile = "C:\my documents\myfile.txt"
       Dim myString As String
    
    'surf to the webpage and read it's content into myString
       Open myFile For Output As #1
       
         myString = Inet1.OpenURL("http://www10.ewebcity.com/dirtbagdog/main.htm", icString)
         ReturnStr = Inet1.GetChunk(2048, icString)
         
         Do While Len(ReturnStr) <> 0
            DoEvents
            myString = myString & ReturnStr
            ReturnStr = Inet1.GetChunk(2048, icString)
         Loop
    
    'save the content of the webpage source to "C:\my documents\myfile.txt"
       Write #1, myString
    Close #1
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Thumbs up API

    I found that there is a very good API function for downloading a file from internet from krigans
    . http://forums.vb-world.net/showthrea...threadid=41471

    Juz take a look on it, and may be you can try it out too.

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