Using win32com for web automation

J Correia correia_jREMOVECAPS at hotmail.com
Tue Jul 26 18:43:21 EDT 2005


> from win32com.client import Dispatch
> from time import sleep
>
> ie = Dispatch('InternetExplorer.Application')
> ie.Visible = 1
> ie.Navigate("http://ispds-sepsr.prv:7500/cs/welcome.jsp")
>
> while ie.ReadyState != 4:
>     sleep(1)
>
> doc = ie.Document
>
> while doc.readyState != "complete":
>     sleep(1)
>
> doc.loginForm.name.value = 'username'
> doc.loginForm.password.value = 'password'
> doc.loginForm.loginform.action = '/cs/login.do'

I can't get to that site to test.
Try the following instead of the last line above:

doc.loginForm.submit()





More information about the Python-list mailing list