Results 1 to 2 of 2

Thread: Grabbing text from a website to form.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2007
    Posts
    69

    Grabbing text from a website to form.

    Is this possible? ive had no experience with the winsock thing yet or anything, i have no idea where to start with this. Ive googled and found not really anything.


    For example i wanna grab some text data that might be somewhere on www.google.com to a textbox.

    Thanks

  2. #2
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: Grabbing text from a website to form.

    One simple way is to use the WebBrowser control.
    In VB menu select, Project, Components, and add the Microsoft Internet Controls.

    Add the WebBrowser control and a textbox to a form. Copy the sample code to the Gen Declare section of the form.

    Code:
    Option Explicit
    
    Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
        On Error Resume Next
        Text1 = WebBrowser1.Document.Body.Innertext
    End Sub
    Private Sub Form_Load()
        WebBrowser1.Navigate "www.google.com"
    End Sub

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