Closed abutremutante closed 8 years ago
I think you have h1
instead of hl
. The third line states there is an issue with your request to Google.
To be clear one is a number the other is the letter 'L'
That was indeed correct, however even correcting it the problem keeps happening.
Do you get the same error or is it different?
Same one but with a portuguese message now (it was able to check my language since now I'm using "hl") - it says something like "Our servers are overloaded, try again later". Maybe I should wait a bit before trying again. I will let you know if that worked.
Response did not parse. See server response for details.
Nossos sistemas estão sobrecarregados no momento e precisam de alguns minutos para voltar ao normal. Tente novamente em alguns instantes.
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pytrends/request.py", line 79, in trend
self.results = json.loads(text)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/json/__init__.py", line 319, in loads
return _default_decoder.decode(s)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/santanna_santanna/PycharmProjects/Predictive Models/APIGtrends.py", line 36, in <module>
google_request()
File "/Users/santanna_santanna/PycharmProjects/Predictive Models/APIGtrends.py", line 26, in google_request
trend=pytrend.trend(search_param,return_type='dataframe')
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pytrends/request.py", line 81, in trend
raise ResponseError(req.content)
pytrends.request.ResponseError: b'<!DOCTYPE html><html ><head>....[LONG LONG HTML CODE]
Worked. Problem solved. Trying to solve a new one now. Thanks again.
@abutremutante I am facing the same issue when requesting from Google, whereas it was working a couple of months ago :
Response did not parse. See server response for details. This page is currently unavailable. Please try again later.Please make sure your query is valid and try again.If you're experiencing long delays, consider reducing your comparison items.Thanks for your patience.
How did you manage to solve this problem exactly? This seems to be due to overcharged servers at Google. Did you just spaced out your request with time.sleep() ?
Thanks for your help.
I'm adapting my application to your new code. I'm using the following code:
Apparently there is a problem here trend=pytrend.trend(search_param,return_type='dataframe')
As you can see in the below traceback:
Any ideas where might be the prob?