>>> import googlefinance
>>> googlefinance.getQuotes('GOOGL')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "googlefinance/__init__.py", line 104, in getQuotes
content = json.loads(request(symbols))
File "googlefinance/__init__.py", line 47, in request
resp = urlopen(req)
File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 435, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 548, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 473, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 556, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: Forbidden
I have tried this on a different computer, on a different network (different IP), same result. I only opened it in Firefox without running Python and it was the same 403 result, so I dont think its just blocking the obvious bot requests.
I am getting a 403 when using the API, see below;
403, looks like Google is blocking bot requests. Visiting in a web browser confirms this - http://finance.google.com/finance/info?client=ig&q=GOOG
I have tried this on a different computer, on a different network (different IP), same result. I only opened it in Firefox without running Python and it was the same 403 result, so I dont think its just blocking the obvious bot requests.