Having a hard time to 'get' bing api search results

Andreas Perstinger andipersti at gmail.com
Fri Jun 14 15:14:41 EDT 2013


On 14.06.2013 20:19, Yves S. Garret wrote:
> This is the error that I'm getting right now.
>>>> import json
>>>> from pprint import pprint
>>>> path = '/home/azureuser/temp.json'
>>>> with open(path) as data_file:
> ...   data = json.load(data_file)
> ...
> Traceback (most recent call last):
>    File "<stdin>", line 2, in <module>
>    File "/usr/local/lib/python2.7/json/__init__.py", line 290, in load
>      **kw)
>    File "/usr/local/lib/python2.7/json/__init__.py", line 338, in loads
>      return _default_decoder.decode(s)
>    File "/usr/local/lib/python2.7/json/decoder.py", line 365, in decode
>      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
>    File "/usr/local/lib/python2.7/json/decoder.py", line 381, in raw_decode
>      obj, end = self.scan_once(s, idx)
> ValueError: Expecting property name: line 2 column 1 (char 2)
>
> Thanks for your inputs Andreas.
>
> Also, this is my JSON file, I'll post again.  Since it's going to be
> messy, I'll include a link as well (users can decide what they prefer
> to read).
> http://bin.cakephp.org/view/1050217914

Ok, I've just copied the text from the site into a file and there is no 
problem loading the file.

You could try the same.

Bye, Andreas



More information about the Python-list mailing list