I'm working with the API of BuscaPé to be able to remove information from some products of the site, the problem is that I can not manipulate one of the values of the json returned. Here are some results I could get:
resp = buscape.find_product_list(keyword='jogos', format='json') # Fazendo a consulta
resp.keys() # Retornou: 'dict_keys(['data', 'code'])'
type(resp['code']) # Retornou: '<\class 'int>'
type(resp['data']) # Retornou: '<\class 'bytes>'
As you can see, when I checked the type of resp ['data'] (field that holds the values I need) python returned me the value 'class bytes', so I can even convert this value to string , the problem is that it would be laborious to look up every information I need that way.
I've tried to do the dump as follows:
import json
json.dumps(resp)
But the interpreter returns the following error: is not JSON serializable .