Solved

Reading HTML-text in MS Internet control Component

Posted on 2001-08-08
10
180 Views
Last Modified: 2010-05-18
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
0
Comment
Question by:theo kouwenhoven
  • 3
  • 3
  • 3
  • +1
10 Comments
 
LVL 18

Expert Comment

by:bobbit31
ID: 6364291
here ya go:

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

End Sub
0
 
LVL 16

Author Comment

by:theo kouwenhoven
ID: 6364494
Wauw that is realy fast....

I go check it this afternoon

Thanks
0
 
LVL 2

Expert Comment

by:TrueDrake
ID: 6364672
Hi,
The lesser the points awarded, the shorter the code ;)
Enjoy
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6366095
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
 
LVL 16

Author Comment

by:theo kouwenhoven
ID: 6367090
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6367726
There is no secret, unfortunatelly there is no WebBrowser1.Document.innerhtml thing
8|
0
 
LVL 18

Accepted Solution

by:
bobbit31 earned 50 total points
ID: 6368180
here ya go:
MsgBox WebBrowser1.Document.documentElement.innerHTML
0
 
LVL 16

Author Comment

by:theo kouwenhoven
ID: 6368705
Great Thanx
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6368919
Bobbit31, amazingly!
0
 
LVL 18

Expert Comment

by:bobbit31
ID: 6369063
thanks... glad to help!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now