Results 1 to 5 of 5

Thread: quick parsing question

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2006
    Posts
    389

    quick parsing question

    I Need to parse a html file and get only the text from the webpage not the html code it self... how do I do this

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    May 2006
    Posts
    389

    Re: quick parsing question

    Or how would I display a webpages source in a textbox?

  3. #3
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: quick parsing question

    Set the TextBox MultiLine = True:
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.     WebBrowser1.Navigate2 ("www.vbforums.com")
    5. End Sub
    6.  
    7. Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    8.  
    9.     If (pDisp Is WebBrowser1.Application) Then
    10.         Text1.Text = WebBrowser1.Document.Body.InnerText
    11.     End If
    12.  
    13. End Sub

  4. #4
    Junior Member
    Join Date
    Jul 2006
    Posts
    22

    Re: quick parsing question

    This can be quite involved and fairly painful lol. It is easier if the website you want to parse has the particular text you want surrounded by specific tags, still not easy but certainly easier. If this is not the case then you need to get the source and use a replace function to remove all the html tags, tedious and not foolproof unless you handle every tag and combination possibe =/

    I personally wouldn't use the webbrowser for this function, it is far too memory intensive, usually around 30mb. I would use Inet, it is quick and easy and on a fast internet connection pretty foolproof.

    VB Code:
    1. Text1.Text = Inet1.OpenURL("http://www.yahoo.com")

  5. #5
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

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