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



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 win32gui.PumpWaitingMessages() to the wait loop
seems to allow both event hooks to run without blocking each other.

Roger


<cal_2pac@xxxxxxxxx> wrote:
> 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, Doc_Events)
>
> IE *fails* to load the webpage
>
> b) Then I changed the delay to a specified time interval eg
> ie.Navigate('www.google.com')
> time.sleep(60) #wait for a minute
> d=win32com.client.DispatchWithEvents(ie.Document, Doc_Events)
>
> IE loads the web page *after* 60 seconds
>
> c) Then I used raw_input() eg
> ie.Navigate('www.google.com')
> raw_input()
> d=win32com.client.DispatchWithEvents(ie.Document, Doc_Events)
> IE now loads the webpage and prompts the user. If I click on the web
> page *before* clicking ok on the raw_input prompt - then it correctly
> invokes the Doc_Events method Ononactivate method.
>
>>>From these observations, it seems that there is some kind of a race
> condition / timing issue happening. Can you please comment (or maybe
> point me to other sources of info that I can investigate).
> I am running Python 2.3 on Windows 2k machine.
>



----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
.



Relevant Pages

  • Re: view page source or save after load
    ... Save the webpage to my computer after it loads (same as File> Save ... urllib is not sufficient (using urlopen or something else in urllib ... UCLA-DOE Institute for Genomics and Proteomics ...
    (comp.lang.python)
  • Re: view page source or save after load
    ... Save the webpage to my computer after it loads (same as File> Save ... urllib is not sufficient (using urlopen or something else in urllib ... Windows, try the Internet Explorer Controller library, IEC: ...
    (comp.lang.python)
  • Re: The Empire Strikes Back
    ... There is a distinction between the webpage pulling in content and an "active ... it is not the web page doing it since the Flash SWF originated ... What matters is how the _web_page_ loads the external ...
    (borland.public.delphi.non-technical)
  • The page cannot be displayed message
    ... I am having a problem opening a specific webpage. ... All other pages are loading ... completely loads. ... -I am using Windows XP Pro. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)