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
MurpheyAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

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
 
MurpheyAuthor Commented:
Wauw that is realy fast....

I go check it this afternoon

Thanks
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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
 
MurpheyAuthor 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
 
MurpheyAuthor Commented:
Great Thanx
0
 
Richie_SimonettiIT OperationsCommented:
Bobbit31, amazingly!
0
 
bobbit31Commented:
thanks... glad to help!
0
All Courses

From novice to tech pro — start learning today.