473,738 Members | 7,110 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Script Error

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\Li b\site-packages\python win\pywin\frame work\scriptutil s.py",
line 307, in RunScript
debugger.run(co deObject, __main__.__dict __, start_stepping= 0)
File
"C:\Python24\Li b\site-packages\python win\pywin\debug ger\__init__.py ",
line 60, in run
_GetCurrentDebu gger().run(cmd, globals,locals, start_stepping)
File
"C:\Python24\Li b\site-packages\python win\pywin\debug ger\debugger.py ",
line 631, in run
exec cmd in globals, locals
File "C:\Documen ts and
Settings\Deskto p\pi\Ressurecti on\Dec\19\CoE.p y", line 4, in ?
ie.SetTextBox(u sername,'txtUse rId',0)
File "cPAMIE.py" , line 387, in SetTextBox
doc = self._ie.Docume nt.forms[frmName]
File "C:\Python24\Li b\site-packages\win32c om\client\dynam ic.py", line
216, in __getitem__
return self._get_good_ object_(self._e num_.__getitem_ _(index))
File "C:\Python24\Li b\site-packages\win32c om\client\util. py", line
37, in __getitem__
return self.__GetIndex (index)
File "C:\Python24\Li b\site-packages\win32c om\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(u sername,'txtUse rId',0)
ie.SetTextBox(p wd,'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

Dec 19 '06 #1
3 2463
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_Ambition s wrote:
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\Li b\site-packages\python win\pywin\frame work\scriptutil s.py",
line 307, in RunScript
debugger.run(co deObject, __main__.__dict __, start_stepping= 0)
File
"C:\Python24\Li b\site-packages\python win\pywin\debug ger\__init__.py ",
line 60, in run
_GetCurrentDebu gger().run(cmd, globals,locals, start_stepping)
File
"C:\Python24\Li b\site-packages\python win\pywin\debug ger\debugger.py ",
line 631, in run
exec cmd in globals, locals
File "C:\Documen ts and
Settings\Deskto p\pi\Ressurecti on\Dec\19\CoE.p y", line 4, in ?
ie.SetTextBox(u sername,'txtUse rId',0)
File "cPAMIE.py" , line 387, in SetTextBox
doc = self._ie.Docume nt.forms[frmName]
File "C:\Python24\Li b\site-packages\win32c om\client\dynam ic.py", line
216, in __getitem__
return self._get_good_ object_(self._e num_.__getitem_ _(index))
File "C:\Python24\Li b\site-packages\win32c om\client\util. py", line
37, in __getitem__
return self.__GetIndex (index)
File "C:\Python24\Li b\site-packages\win32c om\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(u sername,'txtUse rId',0)
ie.SetTextBox(p wd,'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
Dec 22 '06 #2
ie.Navigate ('URL')
ie.SetTextBox(u sername,'txtUse rId',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

Dec 22 '06 #3
"Forced_Ambitio ns" <dh************ @gmail.comwrite s:
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_Ambition s wrote:
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\Li b\site-packages\python win\pywin\frame work\scriptutil s.py",
line 307, in RunScript
debugger.run(co deObject, __main__.__dict __, start_stepping= 0)
File
"C:\Python24\Li b\site-packages\python win\pywin\debug ger\__init__.py ",
line 60, in run
_GetCurrentDebu gger().run(cmd, globals,locals, start_stepping)
File
"C:\Python24\Li b\site-packages\python win\pywin\debug ger\debugger.py ",
line 631, in run
exec cmd in globals, locals
File "C:\Documen ts and
Settings\Deskto p\pi\Ressurecti on\Dec\19\CoE.p y", line 4, in ?
ie.SetTextBox(u sername,'txtUse rId',0)
File "cPAMIE.py" , line 387, in SetTextBox
doc = self._ie.Docume nt.forms[frmName]
File "C:\Python24\Li b\site-packages\win32c om\client\dynam ic.py", line
216, in __getitem__
return self._get_good_ object_(self._e num_.__getitem_ _(index))
File "C:\Python24\Li b\site-packages\win32c om\client\util. py", line
37, in __getitem__
return self.__GetIndex (index)
File "C:\Python24\Li b\site-packages\win32c om\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(u sername,'txtUse rId',0)
ie.SetTextBox(p wd,'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.
Dec 22 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
6024
by: Will Seay | last post by:
At the end of this message I've pasted a script we're trying to modify slightly. I don't believe it is VBscript or javascript but these are the closest groups I could find with my limited programming knowledge. Basically, we are trying to add a few lines to this script that will execute a few shell commands (see comments at the very end of the code). We think this may be ActionScript2 but aren't sure. If you can offer any help, or know...
6
34169
by: Clay Beatty | last post by:
When you create database diagrams in Enterprise Manager, the details for constructing those diagrams is saved into the dtproperties table. This table includes an image field which contains most of the relevant infomation, in a binary format. SQL Enterprise manager offers no way to script out those diagrams, so I have created two Transact SQL components, one User Function and one User Procedure, which together provide a means to script...
12
2990
by: tshad | last post by:
I am not sure why I am getting this error: I have the following code I want to run from another include file that holds all my functions. functions.inc ************************************************************************************ <Script runat="Server"> Sub fnHeader(client As String) response.write("<!-- #include file = ../includes/staffingHeaders.inc -->")
17
7924
by: comp.lang.tcl | last post by:
The TCL command I am using will do a command-line action on a PHP script: set cannotRunPHP I have to do it this way as both the TCL script and the PHP script run as CLI. However, "info.php" requires user input to run; this causes the TCL script calling the PHP script to hose up and die. Is there a way I can do this so that the TCL script can call the PHP
19
3827
by: thisis | last post by:
Hi All, i have this.asp page: <script type="text/vbscript"> Function myFunc(val1ok, val2ok) ' do something ok myFunc = " return something ok" End Function </script>
5
2004
by: Bjorn Sagbakken | last post by:
Hello I have just migrated from VS 2003 to VS 2005, and .NET framework 1.1 to 2.0 I am at the end of debugging and fixing stuff. Now there is one error I just cannot find a solution to: On some pages I have applied a small client-script to trap the enter-key beeing pressed and re-route this action. With the new version this little script still works, it traps the enter-key. BUT it causes postback-errors on many other .NET control,...
15
3251
by: Lawrence Krubner | last post by:
Does anything about this script look expensive, in terms of resources or execution time? This script dies after processing about 20 or 25 numbers, yet it leaves no errors in the error logs. This is on a server that handles a fairly demanding site. The defaults, in php.ini, have all been cranked fairly high: scripts get 180 seconds to run, and they can have as much as 256 megs of RAM. The input for this script is coming from a textarea in...
3
4513
by: GazK | last post by:
I have been using an xml parsing script to parse a number of rss feeds and return relevant results to a database. The script has worked well for a couple of years, despite having very crude error-trapping (if it finds an error in one of the xml files, the script stops). Recently, the script has stopped working because one of the xml files is badly formed. So I decided to rewrite the script with better error trapping; the script should...
1
47476
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script. What You Need Any recent...
7
16166
by: jeddiki | last post by:
Hi, As I am in Turkey at present, I can not see vidoes on youtube. So I have tried a few proxies but keep finding them slow or not working. So I have installed myphpProxy on my server under the domain name www.blog-start.com Unfortuantely it is not not working correctly
0
8788
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9476
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9335
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9263
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6053
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4570
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4825
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2745
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.