Solved

Get outertext of page loaded in Internet Explorer

Posted on 2003-11-11
3
279 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
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
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…

790 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