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

2005-06-22 Thread calfdog
You also want to make sure the frame you want is loaded I use the following method: def _frameWait(self, frameName=None): thisCount = self._timeOut while self._ie.Busy: time.sleep(0.1) thisCount = thisCount - 1 if thisCount == 0: break

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

2005-06-13 Thread J Correia
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Resurrecting an old thread.. It seems that this solution does not return events on objects within frames in webpages eg . if you go to www.andersondirect.com - the page is composed of three frames called as topFrame main and

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

2005-06-12 Thread Roger Upole
Each frame acts as a separate document. You should be able catch document events from a frame using something like win32com.client.DispatchWithEvents(ie.Document.frames(nbr of frame).document, your event class) Roger [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]

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

2005-06-11 Thread cal_2pac
Resurrecting an old thread.. It seems that this solution does not return events on objects within frames in webpages eg . if you go to www.andersondirect.com - the page is composed of three frames called as topFrame main and address. Now when I click on say 'Select a Vehicle' which is within main

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

2005-05-22 Thread cal_2pac
This might make a good candidate for the Cookbook (or there's a collection of IE automation examples at win32com.de) so anybody else trying to do something similar knows some of the pitfalls. This thread has been very valuable for me and has provided clarifications which I could not get after

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

2005-05-22 Thread Roger Upole
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] ... The problem is that msdn documentation says that in order to identify the element that was clicked - one has to query on IHTMLWindow2::event property on iHTMLWindow2 interface to get IEventOBj interface and then from there - use

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

2005-05-21 Thread Roger Upole
There does appear to be some sort of conflict between the two event hooks. I wasn't seeing it before since IE was getting google from my browser cache and it was coming up almost instantaneously. As soon as I switched the URL to a page that loads slowly, I got the same result. Adding

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

2005-05-21 Thread J Correia
Roger Upole [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] There does appear to be some sort of conflict between the two event hooks. I wasn't seeing it before since IE was getting google from my browser cache and it was coming up almost instantaneously. As soon as I switched the

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

2005-05-21 Thread Roger Upole
Reducing the sleep time in the loop also seems to speed things up. I'm guessing due to giving both event loops more resources, but I can't prove it conclusively. This might make a good candidate for the Cookbook (or there's a collection of IE automation examples at win32com.de) so anybody else

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

2005-05-20 Thread cal_2pac
Thanks for the response again. The solution is pretty close but not yet complete This is what I observed. a) I tried to use the delay mechanism as suggested below ie. ie.Navigate('www.google.com') while ie.ReadyState !- 4 time.sleep(0.5) d=win32com.client.DispatchWithEvents(ie.Document,

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

2005-05-20 Thread J Correia
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Thanks for the response again. The solution is pretty close but not yet complete This is what I observed. a) I tried to use the delay mechanism as suggested below ie. ie.Navigate('www.google.com') while ie.ReadyState !- 4

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

2005-05-19 Thread Roger Upole
The two you'll need to run makepy for are Microsoft Internet Controls and Microsoft HTML object Library. If you run them manually, you should be able to look at the generated code to get the guids. Here's a minimal example: import win32com.client

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

2005-05-19 Thread cal_2pac
Hi Thanks for the response and for the code. However, I want to trap events like mouse click on the HTML document loaded by the web browser control. The code mentioned below provides events from the web browser control. I need to find out on which particular HTML tag did the user click for

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

2005-05-19 Thread Roger Upole
ie.Document will give you the document object. That's where the Html object library comes in, it contains the early-binding code for the Document interface. Then you can hook one of the event classes for the Document (I see several in the generated file) using the same methodology as shown for

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

2005-05-19 Thread Roger Upole
Here's a few more lines that hook the document's onactivate event. import win32com.client ie_mod=win32com.client.gencache.EnsureModule('{EAB22AC0-30C1-11CF-A7EB-C05BAE0B}' ,0, 1, 1) doc_mod=win32com.client.gencache.EnsureModule('{3050F1C5-98B5-11CF-BB82-00AA00BDCE0B}' ,0 ,4, 0) class

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

2005-05-19 Thread cal_2pac
Thanks for your prompt responses and the code. However, when I run the code I get com error d=win32com.client.DispatchWithEvents(ie.Document, Doc_Events) File C:\Python23\lib\site-packages\win32com\client\__init__.py, line 199, in __getattr__ return getattr(self._obj_, attr) File

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

2005-05-18 Thread cal_2pac
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