How to receive events (eg. user mouse clicks) from IE



I am trying to trap events from internet explorer eg. when user clicks
on an html link - I need to get notified for that event.

After looking through the newgroups / internet and reading through
various sections in programming python on win32 - I understand that
this can be done using DispatchWithEvents.
I have also referred to discussions on comp.lang.python
http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/a3c502d06412a5f8/0ee3083e71316da7?q=dispatchwithevents&rnum=43#0ee3083e71316da7

and

http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/1da0668794851296/5bcec1fda216c598?q=dispatchwithevents&rnum=19#5bcec1fda216c598

So far - none of the newgroups postings report that IE events were
trapped successfully (at least I could not find any). However, there is
enough evidence that it can be done.
My problems at the moment:
a) The examples use early binding. However, I cannot get Python makepy
to generate the code to force makepy process at run time - since COM
makepy utility that I invoke from python win 32 does not have any entry
for internet explorer.
I tried to find the CLSID for IE 3050F613-98B5-11CF-BB82-00AA00BDCE0B
but I get an exception
b) Also one of the examples suggest that following code should work

> mod = EnsureModule(...)

> class MyEvents(mod.IDocumentEvents):
> # your methods here....

> handler = MyEvents(ie.document)

> # handler should start recieving events.

however, what CLSID is to be used in EnsureModule... . I tried with a
few but I always get the error 'NoneType' object has no attribute
'IDocumentEvents'


An example that 'works' will be very useful

.



Relevant Pages

  • Re: Automating IE 6.0
    ... Microsoft Internet Controls Internet Explorer to print from python. ... # print the current IE document without prompting the user for the ... When I found the registry listing that had the associated CLSID I then ...
    (comp.lang.python)
  • Re: Automating IE 6.0
    ... Internet Explorer to print from python. ... I used the makepy utility on the "Microsoft Internet Controls " object ...
    (comp.lang.python)
  • Embedding an Application in a Web browser
    ... Is it possible to embed a Python application within Internet explorer? ... If so how do people recommend going about it. ... Python Newbie ...
    (comp.lang.python)
  • Recording web page URLs
    ... I'm building a python application that will monitor a person's behavior with his mouse while surfing the web (probably using Internet Explorer). ... Do you Yahoo!? ...
    (comp.lang.python)