Re: Beating a Timeout

2009-01-21 Thread K-Dawg
Sorry about the last mesasge, I accidentally replied directly to the
poster.  So I now have:


br = mechanize.Browser()
br.open("theURL")
while True:
 result = br.reload()
 print result
 print "Retrieved Page"
 time.sleep(300)

But it still does not appear to be working...  Shortly after I got the "Your
session is about to expire" pop up.  I will continue to monitor though.

Is mechanize starting another session separate from my IE?  Is there anyway
to get my python to interact with the IE session if so?

Thanks.

Kevin
--
http://mail.python.org/mailman/listinfo/python-list


Re: Beating a Timeout

2009-01-21 Thread MRAB

K-Dawg wrote:

Hi,

I am trying to write a python script that I can run to prevent a timeout 
of webpage.  I have to use a system at work that keeps track of issues.  
I use this a couple of time an hour and it times out after 10 minutes.  
The system is really crummy and it rejects your username and password 
about 30-40 times before it takes it.  It is supposed to integrate with 
Active Directory and I don't think it does it very well.


So I have this open in Internet Explorer (its all in asp.net 
 so it does not work in any other browser).  I was 
hoping to have something simple like:


#c:\Python25\python

import urllib
import urllib2
import time

while True:
 result = urllib.urlopen("the_URL 
")

 print "Retrieved Page"
 time.sleep(300)

But this is not working  The code on the page uses a hidden iFrame 
that has a javascript file that monitors the time and intiates the 
timeout.  The src of the hidden iFrame is what I keep trying to grab.


It is still timing out in IE.  Once it times out in IE I get an error in 
my script saying:


IOError:  [Errno socket error] (10060, 'Operation timed out')

The system is terrible but I am stuck with it.  If it doesn't kick me 
out, at least its bearable...


Thanks for any help you can provide.


Have you looked at mechanize?

http://wwwsearch.sourceforge.net/mechanize/
--
http://mail.python.org/mailman/listinfo/python-list


Re: Beating a Timeout

2009-01-21 Thread K-Dawg
Also, the actual JS code that does this simply uses a

window.location.reload()

to keep the session active.  So I guess the only thing could be that eash
urllib.urlopen call is seen as a new session?  How can I make it part of the
same session I am using in IE?  Or am I a hundred miles off?

Thanks for any help.

Kevin
--
http://mail.python.org/mailman/listinfo/python-list


Beating a Timeout

2009-01-21 Thread K-Dawg
Hi,

I am trying to write a python script that I can run to prevent a timeout of
webpage.  I have to use a system at work that keeps track of issues.  I use
this a couple of time an hour and it times out after 10 minutes.  The system
is really crummy and it rejects your username and password about 30-40 times
before it takes it.  It is supposed to integrate with Active Directory and I
don't think it does it very well.

So I have this open in Internet Explorer (its all in asp.net so it does not
work in any other browser).  I was hoping to have something simple like:

#c:\Python25\python

import urllib
import urllib2
import time

while True:
 result = urllib.urlopen("the_URL
")
 print "Retrieved Page"
 time.sleep(300)
But this is not working  The code on the page uses a hidden iFrame that
has a javascript file that monitors the time and intiates the timeout.  The
src of the hidden iFrame is what I keep trying to grab.

It is still timing out in IE.  Once it times out in IE I get an error in my
script saying:

IOError:  [Errno socket error] (10060, 'Operation timed out')

The system is terrible but I am stuck with it.  If it doesn't kick me out,
at least its bearable...

Thanks for any help you can provide.

Kevin
--
http://mail.python.org/mailman/listinfo/python-list