Internet Explorer and Python/COM

Mark Hammond MarkH at ActiveState.com
Sun Jul 2 20:37:27 EDT 2000


"Roger Upole" <cb750chris at email.msn.com> wrote in message
news:u$mxTiH5$GA.254 at cpmsnbbsa07...

> Here's a small sample of how to navigate to a URL.
> >>> import win32com.client
> >>> x=win32com.client.Dispatch('InternetExplorer.Application.1')
> >>> x.Visible=1
> >>> x.Navigate('http://www.python.org')
> If you run makepy on Microsoft Internet Controls, the file generated in
> Python\win32com\genpy will show all the properties and methods
> available for this object.

This will work fine to control IE.

However, look in "win32com\client\__init__.py", and look for the
"DispatchWithEvents" docstring - this has an example that uses IE to both
control it, and respond to events (such as URL load completed, etc)

Mark.






More information about the Python-list mailing list