Script Error
Forced_Ambitions
dhingra.mayank at gmail.com
Tue Dec 19 01:39:30 EST 2006
Hi Guys,
I am facing a problem with a script that i had written to automate
opening a website and signing on to it. It was running fine for a long
time but all of a sudden it has stopped progressing beyond opening the
URL. I ran the code line by line on the pythonwin's IDE and it ran fine
but when i execute the whole script it gives this error:
Traceback (most recent call last):
File
"C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py",
line 307, in RunScript
debugger.run(codeObject, __main__.__dict__, start_stepping=0)
File
"C:\Python24\Lib\site-packages\pythonwin\pywin\debugger\__init__.py",
line 60, in run
_GetCurrentDebugger().run(cmd, globals,locals, start_stepping)
File
"C:\Python24\Lib\site-packages\pythonwin\pywin\debugger\debugger.py",
line 631, in run
exec cmd in globals, locals
File "C:\Documents and
Settings\Desktop\pi\Ressurection\Dec\19\CoE.py", line 4, in ?
ie.SetTextBox(username,'txtUserId',0)
File "cPAMIE.py", line 387, in SetTextBox
doc = self._ie.Document.forms[frmName]
File "C:\Python24\Lib\site-packages\win32com\client\dynamic.py", line
216, in __getitem__
return self._get_good_object_(self._enum_.__getitem__(index))
File "C:\Python24\Lib\site-packages\win32com\client\util.py", line
37, in __getitem__
return self.__GetIndex(index)
File "C:\Python24\Lib\site-packages\win32com\client\util.py", line
56, in __GetIndex
raise IndexError, "list index out of range"
IndexError: list index out of range
The code i was using is:
import cPAMIE
ie= cPAMIE.PAMIE()
ie.Navigate ('URL')
ie.SetTextBox(username,'txtUserId',0)
ie.SetTextBox(pwd,'txtPassword',0)
ie.ClickButton('btnSubmit',0)
Any ideas as to why am i getting this error when running the code as a
script
Thanks in advance,
Forced
More information about the Python-list
mailing list