#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    8
    Rep Power
    0

    Web browser programing in vb


    I want to connect to a site in Visual Basic,
    I can load the site with a web browser , but i'd like show any ideal part of my siteو i can not do this
    If anyone knows, please help me
  2. #2
  3. Humble Learner
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2007
    Location
    Bangalore, India
    Posts
    280
    Rep Power
    120
    The browser control that is shipped with VB 6.0 is supported with very basic features of web browsing. It does not support the features that you are looking for.
  4. #3
  5. JavaScript is not spelt java
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2011
    Location
    Landan, England
    Posts
    743
    Rep Power
    165
    Your question is unclear and which version of VB are we talking about?

    You can read web page content in VBA (VBScript, VB6, etc..) using automation. Here's an example with VBA:

    Code:
    Option Explicit
    
    'Declare Sleep API
    Private Declare Sub Sleep Lib "kernel32" (ByVal nMilliseconds As Long)
    
    Sub UseIE()
        Dim ie As Object
        Dim thePage As Object
        Dim strTextOfPage As String
        
        Set ie = CreateObject("InternetExplorer.Application")
        ie.FullScreen = True
        With ie
            .Visible = True
            .Navigate "http://www.bbc.co.uk"
            While Not .ReadyState = READYSTATE_COMPLETE
                Sleep 500      'wait 1/2 sec before trying again
            Wend
        End With
        
        Set thePage = ie.Document
        Debug.Print thePage.Title
        Debug.Print thePage.fileSize
        Worksheets.Add
        'ActiveCell.Value = thePage.documentElement.innerHTML
        strTextOfPage = thePage.documentElement.innerHTML
        
        'ie.Quit
        
        Set thePage = Nothing
        Set ie = Nothing
        
    End Sub
  6. #4
  7. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,439
    Rep Power
    4539
    http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx
    There used to be a tutorial on msdn showing how to build your own customized web browser application using the IE webbrowser control and VB6.
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    8
    Rep Power
    0
    Thank you
    youre Answers were very helpful., But my question was how to tell if a page has fully loaded?
  10. #6
  11. JavaScript is not spelt java
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2011
    Location
    Landan, England
    Posts
    743
    Rep Power
    165
    Originally Posted by senator
    Thank you
    youre Answers were very helpful., But my question was how to tell if a page has fully loaded?
    Your original post does not ask this question. I think you need to clarify you question. Ask a specific question and, in particular, detail what VB environment you are using (VBScript, VBA, VB6, VB.Net?).
  12. #7
  13. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,439
    Rep Power
    4539
    Originally Posted by AndrewSW
    Your original post does not ask this question. I think you need to clarify you question. Ask a specific question and, in particular, detail what VB environment you are using (VBScript, VBA, VB6, VB.Net?).
    Apparently you didn't review the entire thread. I deleted the original question from this topic.

    I'm closing this thread, OP please re-ask in a new topic if your problem is not fixed.
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester

IMN logo majestic logo threadwatch logo seochat tools logo