Using win32com for web automation

calfdog at calfdog at
Mon Aug 1 22:29:22 CEST 2005

ina wrote:
> Look up pamie it should do all the work you need.  If it dosn't I can
> send you ishyBrowser but pamie has more comunity support.


from win32com.client import Dispatch
from time import sleep

# Create a new browser object
ie = Dispatch('InternetExplorer.App­lication')

# Make the browser visible
ie.Visible = 1

# Navigate to the site

# wait for the document to fully load
while ie.ReadyState != 4:

doc = ie.Document

while doc.readyState != "complete":

# set the textbox value for name to 'some_string' = 'username'

# set the textbox value for password to 'some_string'

doc.loginForm.password.value = 'password'

# submit the form

Added some comments to make it clearer

You will now need another wait for the next document you load
You can put the wait into a wait method

or you could try PAMIE

Hope it helps

More information about the Python-list mailing list