?
Solved

Reading HTML-text in MS Internet control Component

Posted on 2001-08-08
10
Medium Priority
?
186 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month9 days, 11 hours left to enroll

762 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