On Tue, May 16, 2006 at 01:24:25PM +0000, John Bokma wrote: > [EMAIL PROTECTED] wrote: > > > It's quite strange, after calling the script several times it started > > to work; but sometimes the error occurs again. Maybe google has > > technical probs. > > Yup, I've seen exactly the same behavoir. So now I do several retry - > sleep - retry steps before giving up.
Yup, me too. retries = 0 while (retries < 5): try: gpage = google.doGoogleSearch(keyword, start=start) break except: retries += 1 time.sleep(30) else: raise # chronic failure, reraise the last error The job runs nightly at O'Dark thirty. I get one chronic failure every few months. -Jack -- http://mail.python.org/mailman/listinfo/python-list