Reading HTML-text in MS Internet control Component

Hi,

Here is my problem (or your challenge):

I have a form with a MS Internet Control Component (and some buttons etc.).
When I drag an URL to this Internet Control Component, I will be able to read (and display) the HTML-text from the displayed page, so that I can filter some tags, text and links.

Can anybody tell me how I can do that?

Thanks
LVL 17
MurpheyApplication ConsultantAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
bobbit31Connect With a Mentor Commented:
here ya go:
MsgBox WebBrowser1.Document.documentElement.innerHTML
0
 
bobbit31Commented:
here ya go:

Private Sub Command1_Click()
WebBrowser1.Navigate "<url>"
While WebBrowser1.Busy
    DoEvents
Wend
MsgBox WebBrowser1.Document.body.innerHTML

End Sub
0
 
MurpheyApplication ConsultantAuthor Commented:
Wauw that is realy fast....

I go check it this afternoon

Thanks
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
TrueDrakeCommented:
Hi,
The lesser the points awarded, the shorter the code ;)
Enjoy
0
 
Richie_SimonettiIT OperationsCommented:
Just a little modification to bobbit31 code:


Private Sub Command1_Click()
WebBrowser1.Navigate "<url>"
' comment this code:
'While WebBrowser1.Busy
'   DoEvents
'Wend
End Sub

Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)

If (pDisp Is WebBrowser1.Object) Then
    MsgBox WebBrowser1.Document.body.innerhtml
End If

End Sub
0
 
MurpheyApplication ConsultantAuthor Commented:
Yes bobbit31,

It works almost exactly on the way I like it, but I get only the <BODY> part of the page, not the <HEAD> part of it....

Of course i have tried to change the "WebBrowser1.Document.body.innerhtml" in to "WebBrowser1.Document.head.innerhtml" and "WebBrowser1.Document.innerhtml", but that would be to obvious.

So what is the secret???

0
 
Richie_SimonettiIT OperationsCommented:
There is no secret, unfortunatelly there is no WebBrowser1.Document.innerhtml thing
8|
0
 
MurpheyApplication ConsultantAuthor Commented:
Great Thanx
0
 
Richie_SimonettiIT OperationsCommented:
Bobbit31, amazingly!
0
 
bobbit31Commented:
thanks... glad to help!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.