Solved

Get outertext of page loaded in Internet Explorer

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

732 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