Closed simonmcnair closed 1 year ago
I tried this too:
for key, value in vars(search).items():
print(key, ":", value)
if key == 'result':
data = json.loads(str(value))
sorry if it's wrong. I'm a newb.
Hi @simonmcnair,
The json.loads()
method can be used to parse a valid JSON string and convert it into a Python Dictionary. Nonetheless, search.result
already comes in a Python dict format, hence this function doesn't work here. See here.
Thanks and best, Elise
Hi, I'm trying to use the json output from search as a variable and using
data = json.loads(str(search.result))
but it's failingerror Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
. I just wondered if you can only use json with file output, and if so, why ?Cheers Simon