Solved

Reading HTML-text in MS Internet control Component

Posted on 2001-08-08
10
179 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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 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…

708 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

18 Experts available now in Live!

Get 1:1 Help Now