Results 1 to 4 of 4

Thread: Import Website Source Code into VB5

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2005
    Posts
    2

    Import Website Source Code into VB5

    So I've got VB5 running here, and what I'd like to do is to import the source code of one of my web pages (i.e. the View > Page Source on Firefox) into a text box in my VB program.

    Just to make clear, I want something coming up like
    HTML Code:
    <html>
    <title>I can't believe it</title>
    <body>
    This is a n00b question
    </body>
    </html>
    as opposed to the formatted stuff.

    Now I'd like to do this with some nice easy code, and preferable without the use of components (seens as I do a fair bit of VB work on a shared computer where there's generally quite a bit of trouble with components).

    I've had a two-hour Googling session and come up with nothing, so if you come up with anything, I'd be most grateful (as you'd expect).

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

    Re: Import Website Source Code into VB5

    Are you using the Webbrowser control? If not, add this control to your form (Microsoft Internet controls) and set its visibility to false.

    VB Code:
    1. Webbrowser1.navigate = "www.google.com"
    2. msgbox WebBrowser1.Document.body.innerHTML

    Hope this helped
    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
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Import Website Source Code into VB5

    You may also use the Microsoft Internet Transfer Control...

    VB Code:
    1. Dim str As String
    2. str = Inet1.OpenURL("www.vbforums.com")
    3. MsgBox str
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  4. #4

    Thread Starter
    New Member
    Join Date
    Dec 2005
    Posts
    2

    Re: Import Website Source Code into VB5

    Well thanks guys for the help: I think dee-u's was more useful seens as VB didn't like the .document.body.innerhtml argument. Anyway, problem sorted and thanks again.

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