Handling Com Events in Python (was Python and Windows Scripting Host)

Syver Enstad syver.enstad at sensewave.com
Thu Aug 10 15:57:48 EDT 2000


Cool of you to really shake out the behaviour of it. I am going look over
your source to learn more Python.

> This "polling" approach is pretty cumbersome, but at least it does
> let you fake OnDocumentComplete reasonably well.

Yes, not so sweet to poll it. Maybe we could use the propertyChange event to
decide when to poll? Have never tried it so just suggestion. Must remember
to check that out.

> For example (I've done this with VB and with VC++): use IE to let
> the user 'explore' a locally simulated 'site' that is made up of both
> real HTML document, images, etc (with extensions in a known set
> such as .htm, .html, .gif, etc), AND "pseudo-documents" which in
> fact are generated on the fly by my code when the user "visits" them.
>
> To achieve the latter effect through automation of IE, I verify the
> BeforeNavigate events and, if from the URL I see that a pseudo-doc
> is being 'visited', I block the navigation and instead proceed to
> modify the current-document (using the various DHTML possibilities).

Cool idea with the BeforeNavigate things. I am currently working on a
project involving a plugin/browser extension in Microsoft explorer, where we
modify web pages the user visits on the fly so I was naturally using IE
automation to check out the Python COM support and how far you could push
it.

Regarding the missing DocumentComplete events, I think I have experienced
something similar when using a console application (C++) to automate IE.
Don't think I got DocumentComplete events then either.





More information about the Python-list mailing list