4 Replies - 4488 Views - Last Post: 29 January 2011 - 08:07 PM Rate Topic: -----

#1 netresources  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 16-December 10

get body of webpage vb6

Posted 25 January 2011 - 03:25 PM

I try many things but could not find it.


txtResult(1).Text = WebBrowser1.document.Body.InnerText
    txtResult(2).Text = WebBrowser1.document.Body.OuterText
    txtResult(3).Text = WebBrowser1.document.Body.InnerHtml
    txtResult(4).Text = WebBrowser1.document.Body.OuterHtml




please help to get only text in webpage body.

thinks
Is This A Good Question/Topic? 0
  • +

Replies To: get body of webpage vb6

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4354
  • View blog
  • Posts: 12,160
  • Joined: 18-April 07

Re: get body of webpage vb6

Posted 25 January 2011 - 05:55 PM

You should have been able to get it using WebBrowser1.document.Body.InnerHtml but another thing you can also try is using an MSHTML...

Dim yourDocument As MSHTML.HTMLDocument
Set yourDocument = WebBrowser1.Document
Msgbox yourdocument.documentElement.outerHTML



This is used after you add the MSHTML library to your project. Once you have this, you can pick out the body from it. :)
Was This Post Helpful? 0
  • +
  • -

#3 netresources  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 16-December 10

Re: get body of webpage vb6

Posted 26 January 2011 - 03:18 AM

hi,
thanks a lot but this code will get all text in the page.
but what I need is just the body of the page or the paragraphs.

thanks
Was This Post Helpful? 0
  • +
  • -

#4 Jack Eagles1  Icon User is offline

  • Pugnacious Penguin (inspired by no2pencil)
  • member icon

Reputation: 183
  • View blog
  • Posts: 1,152
  • Joined: 10-December 08

Re: get body of webpage vb6

Posted 26 January 2011 - 07:04 AM

If you mean the text which is displayed to the user in the frontend of the webbrowser, it should be:
WebBrowser1.document.Body.InnerText


Was This Post Helpful? 0
  • +
  • -

#5 netresources  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 16-December 10

Re: get body of webpage vb6

Posted 29 January 2011 - 08:07 PM

thanks a lot but still not solve my problem I got other text beside the body of the webpage.

it should there is away to get the paragraphs in the webpage.

thanks
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1