Solved

Get outertext of page loaded in Internet Explorer

Posted on 2003-11-11
3
283 Views
Last Modified: 2012-06-21
Experts, I don't have time to figure this out, so here's 400 points to anyone that can provide me a good answer with full source code. Here's The situation for which I am in urgent need of a solution: I have one instance of Internet Explorer already running. I want to run a vb program that will capture the outertext of the current page being displayed in that Internet Explorer. The vb program should know which browser to grab it from based on the page title or url.  (I cannot reload that page, as it will feed different results each time--so Inet, browser control, etc, is out of the question).  I simply need to get the contents of a page already loaded in a particular instance of Internet Explorer.  Many thanks in advance!
0
Comment
Question by:John Account
[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 Comments
 
LVL 7

Accepted Solution

by:
_agj_ earned 400 total points
ID: 9728560
the following code assumes that u have an instance of IE open and with ur 'WANTED' page open.

Private Sub Form_Load()

Dim ie

Set ie = GetObject(, "InternetExplorer.Application")

'this prints the body part
Debug.Print ie.document.body.innerHTML

'to print the first element (mebbe u cud loop through the items or something if u need)
'Debug.Print ie.document.All.Item(0).innerHTML

Set ie = Nothing

End Sub

this shud giv u the stuff...mostly.
if u want outerHTML or some other element, change suitably.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 10537283
Moderator, my recommended disposition is:

    Accept _agj_'s comment(s) as an answer.

Dan Rollins -- EE database cleanup volunteer
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

729 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