Script Error

F

Forced_Ambitions

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
 
F

Forced_Ambitions

Guys any suggestions ?

Could it be because of a MS patch or something as i believe i had some
patching on the windows box i was running this script on.
 
J

Justin Ezequiel

ie.Navigate ('URL')
ie.SetTextBox(username,'txtUserId',0)

not sure but shouldn't you be waiting for navigate to actually
finish loading the page before setting fields?

see the ie.Busy or ie.readyState properties/methods
 
P

Pyenos

Forced_Ambitions said:
Guys any suggestions ?

Could it be because of a MS patch or something as i believe i had some
patching on the windows box i was running this script on.


Forced_Ambitions said:
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

could you tell me more about the module, cPAMIE? if you can, give me a
link to a documentation of this module.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top