Solved

Reading HTML-text in MS Internet control Component

Posted on 2001-08-08
10
181 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
ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

 
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
 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

777 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