Google-API Bad-Gateway-Error

Jack Diederich jack at performancedrivers.com
Tue May 16 11:37:44 EDT 2006


On Tue, May 16, 2006 at 01:24:25PM +0000, John Bokma wrote:
> DierkErdmann at mail.com 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



More information about the Python-list mailing list