Using HTTP requests in Python, I was able to get the answer, however, neither json nor simplejson modules can unpack it. Both claim input is not good json.
import requests
import json
html_base = u"http://www.google.com/trends/fetchComponent?q="
q = u"asdf,qwerty"
query_type = u"&cid=TIMESERIES_GRAPH_0&export=3"
full_query = html_base + q + query_type
response = requests.get(full_query)
data = json.loads(response.text)
Error:
C:\Anaconda\lib\json\decoder.pyc in raw_decode(self, s, idx)
382 obj, end = self.scan_once(s, idx)
383 except StopIteration:
385 return obj, end
ValueError: No JSON object could be decoded
source
share