473,385 Members | 1,218 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Google-API Bad-Gateway-Error

Hi,

I am trying to query google from within a python script using the
Google-Api (pygoogle).
The following piece of codes gives me a "SOAPpy.Errors.HTTPError:
<HTTPError 502 Bad Gateway>", the full Traceback is shown below. I am
aware of the incompatibilities between the Google-Api and older
versions of the SOAP-Library; I do have installed a recent version of
SOAP (v. 0.11.3) which is said to be supported by Google-API.

Can someone help?
TIA
Dierk

Source-Code:
######
import google
google.setLicense('xxxxxxxxxxxxxxxxx') ##removed ;-)
data = google.doGoogleSearch('python')
data.meta.searchTime
data.results[0].URL
data.results[0].title
########

Full Traceback:
#############
Traceback (most recent call last):
File "test.py", line 3, in ?
data = google.doGoogleSearch('python')
File "/windows/g/Download/webcrawler/pygoogle-0.6/google.py", line
421, in doGoogleSearch
outputencoding )
File "/usr/lib/python2.4/site-packages/SOAPpy/Client.py", line 421,
in __call__
return self.__r_call(*args, **kw)
File "/usr/lib/python2.4/site-packages/SOAPpy/Client.py", line 443,
in __r_call
self.__hd, self.__ma)
File "/usr/lib/python2.4/site-packages/SOAPpy/Client.py", line 345,
in __call
config = self.config)
File "/usr/lib/python2.4/site-packages/SOAPpy/Client.py", line 249,
in call
raise HTTPError(code, msg)
SOAPpy.Errors.HTTPError: <HTTPError 502 Bad Gateway>
#############

May 16 '06 #1
4 3136
Di**********@mail.com wrote:
Hi,

I am trying to query google from within a python script using the
Google-Api (pygoogle).
The following piece of codes gives me a "SOAPpy.Errors.HTTPError:
<HTTPError 502 Bad Gateway>",


Not with Python, but with Perl, I am seeing now and then the same error.
If you rerun the script, does the message go away?

A week or 2-3 ago I had even the feeling that the Google API was gone for
about a day.

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
May 16 '06 #2
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.

Dierk

May 16 '06 #3
Di**********@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.

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
May 16 '06 #4
On Tue, May 16, 2006 at 01:24:25PM +0000, John Bokma wrote:
Di**********@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
May 16 '06 #5

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

Similar topics

18
by: Brian Murphy | last post by:
I own a PHP-based website.I want to encrypt the HTML output.That will for sure make the site unindexable by Google.Is there a way to encrypt the output to the users but not to Google.I suppose that...
13
by: fuzzyman | last post by:
I've hacked together a 'GoogleCacheServer'. It is based on SimpleHTTPServer. Run the following script (hopefully google groups won't mangle the indentation) and set your browser proxy settings to...
19
by: Christian Hvid | last post by:
Hello groups. I have a series of applet computer games on my homepage: http://vredungmand.dk/games/erik-spillet/index.html http://vredungmand.dk/games/nohats/index.html...
3
by: Alastair | last post by:
Hello guys, I've been building a search facility for an intranet site I'm part of developing and we've been building a search engine using Index Server. It mostly works, however there have been...
25
by: Tor Erik Sønvisen | last post by:
Hi I need to browse the socket-module source-code. I believe it's contained in the file socketmodule.c, but I can't locate this file... Where should I look? regards tores
9
by: Ray5531 | last post by:
Sorry if this is irrelevant to this website,but I didn't find a better place to ask this question.I sent an email to google as well which I didn't recieve the answer.I'm creating a website and...
16
by: Duncan Booth | last post by:
Google have announced a new service called 'Google App Engine' which may be of interest to some of the people here (although if you want to sign up you'll have to join the queue behind me): From...
9
by: maheswaran | last post by:
Hi all, I developed one application. From that application i created dynamic pages contact us , about us...(like joomla, but application is not in joomla)... These all are comes from database.In...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.