473,549 Members | 2,531 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FOUND! how to attach to running instances of Internet Explorer

Most folks know you can start up an instance of Internet Explorer by
saying "x=win32com.cli ent.Dispatch('I nternetExplorer .Application.1' )"
and you get a WIN32 object with a "Document" object that has arrays of
"Link"/"Form"/"Frame" subobjects, and methods like "Navigate" where
you can force the IE instance to browse to a new URL.

What folks would like to do is to connect to an already running
version of explorer, and this isn't so obvious.

The MS KB article you usually find is 176792 which mentions using
SHDocVw.ShellWi ndows to iterate through the instances. However Mark
Hammond sayes this is a "vtable interface" (whatever that is) and "not
supported by python" in
http://groups.google.com/groups?hl=e...pretection.com

HA! well, I happened to discover you can do:

import win32com.client
# look in the makepy output for IE for the "CLSIDToClassMa p"
# dictionary, and find the entry for "ShellWindo ws"
clsid='{9BA0597 2-F6A8-11CF-A442-00A0C90A8F39}'
ShellWindows=wi n32com.client.D ispatch(clsid)
for i in range(ShellWind ows.Count):
print i
# this is the titlebar value
print ShellWindows[i].LocationName
# this is the current URL
print ShellWindows[i].LocationURL
print

and the object returned by ShellWindows[n] is the exact same as the
one returned by Dispatch('Inter netExplorer.App lication.1')

I'm posting this here for future generations of Googlers.

So I'm running Win2K Pro... and I'm curious about what versions this
works under. I'm pretty sure you have to have IE 5.0 or newer, but
could folks try this code on 95/98 and tell me (gcash-at-cfl.rr.com)
if it works??

Also, I haven't been able to determine if there's a better name of the
form 'InternetExplor er.Application. 1' instead of using the horrid
class-id. How do you do that? The makepy output for explorer doesn't
list one.

Thanks to Mark Hammond for win32all, it is a true work of art, and is
teaching an old UNIX hack lots of Windows stuff.

-gc

--
I've never tried emacs because I already _have_ an OS on this peecee.
-- mi***@mikea.ath .cx (Mike Andrews)
Jul 18 '05 #1
3 9424
gcash ....

Your win32 script for connecting to open IE instances
works fine for me using ....

Win98_SE
Python 2.2.1

Displays info for open IE instances
for both local and remote pages ....

--
Cousin Stanley
Human Being
Phoenix, Arizona
Jul 18 '05 #2
"Cousin Stanley" <Co***********@ hotmail.com> writes:
Your win32 script for connecting to open IE instances
works fine for me using ....

Win98_SE
Python 2.2.1


Awesome! That gives me hope it isn't some one-off WIN2K thing.
Cool! Thanks.

-gc

--
I've never tried emacs because I already _have_ an OS on this peecee.
-- mi***@mikea.ath .cx (Mike Andrews)
Jul 18 '05 #3
> Also, I haven't been able to determine if there's a better name of the
form 'InternetExplor er.Application. 1' instead of using the horrid
class-id. How do you do that? The makepy output for explorer doesn't
list one.


The relevant MSDN page[1] lists the ProgID as 'Shell.Windows' or
'ShellWindows._ NewEnum'; however when trying to dispatch with either as the
class string fails. Also, searching the registry reveals nothing for the
CLSID.

[1] http://tinyurl.com/ix1z , i.e.
http://msdn.microsoft.com/library/de.../objectmap.asp

Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2342
by: Randy Jackson | last post by:
Hello everyone. First of all, apologies in advance if this is a question that gets asked all the time. I tried to search, but wasn't really sure exactly what to search for. Anyway, here's the issue. I've written a simple page in PHP. It displays just fine in Netscape, but for some reason the screen is absolutely blank in Internet...
1
6446
by: bjwang | last post by:
Hello wisers, We are testing a system which is developed on top of Oracle 9iAS. The client PCs are using Internet Explorer to access the system. We are sure that the Oracle 9i database server is set to use Unicode. The Oracle 9i database server and Oracle 9iAS server are now running on English Windows 2000 server. With client PCs running on...
12
19566
by: SunshineGirl | last post by:
I'm trying to receive events from a running instance of Internet Explorer. So far I've only been able to receive events from an instance I launch from code, but I need to receive events from all running instances of Internet Explorer (I mean those that the user launches himself). I know this is possible because I did it three months ago....
0
1368
by: Florin M | last post by:
I am running a custom application developed with ASP.NET 1.1, C# and Visual Studio 2003. I recently installed SP2 for XP Professional. When I close the Internet Explorer window where the app runs, Internet Explorer crashes and I get the generic error message window with DEBUG, SEND ERROR REPORT & DON'T SEND buttons. I checked the event...
6
3299
by: Thomas | last post by:
Hi, I'm having a problem with the dynamically created inputfields in Internet Explorer. The situation is the following: - I have a dynamically created table with a textbox in each Cell. - It is possible to Add and Delete rows - Some cells have special attributes (readonly and events) Here's a snippet of the code:
11
2006
by: GHUM | last post by:
Hello, I created some rather complex Intranet Application, using lots of JavaScript, DOM-Maninpulation and XMLHTTPRequest communication. I developed on FireFox, with the excellent firebug ... every misstake was given back with a fine, fine traceback; exactly pointing to the code at error. My code runs fine on FireFox and Opera.
4
2556
by: redoix | last post by:
Sometimes There To Many Instance Of The Internet Browsing Page Running On The Taskbar. This Slows Down Connection.how Do I Limit The Instances Of Internet Browsers So That One The Limit Is Reached Additional Page Can Not Be Opened
26
2246
by: Prisoner at War | last post by:
Hi, All: I have a JavaScript search engine that always causes MSIE 7 to do a top-of-page security "warning" (that top-of-page-bar, and not an "alert" )...but other websites' JavaScripts do not trigger that...what's going on? When I visit other JavaScript sites there's no warning and the scripts work fine, but mine (it's still under...
0
1491
by: Bill Corry | last post by:
I have been trying to get an instance of internet explorer to navigate to a website using the Navigate2 command. When the navigation request uses the Get method (just a URL) there is no problem. However, when the navigation involves the post method two instances of internet explorer are created. One of the instances is uninitialized while the...
0
7526
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7723
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7483
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7817
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6051
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5375
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5092
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1063
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
771
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.