get text data from HTML. #2

Badi

Member
Joined
Mar 24, 2013
Messages
11
Programming Experience
1-3
example: http://www.cfr.org/about/contact.html

PI3Rwi9.png

3yzDH28.png


can i know how it works thanks.
 
I wrote this up (tested and works for me). It returns contents of any form/div/etc that has an ID specified. The below code works for the site you provided, although you would need to parse out the info you dont need. Try it out.

VB.NET:
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

WebBrowser1.Navigate("http://www.cfr.org/about/contact.html")

    End Sub

    Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        MsgBox(WebBrowser1.Document.GetElementById("center").InnerText)
    End Sub
 
Back
Top