Pregunta

I have a yelp response as linked here. I am trying to print out just a list of the names returned. I have tried the following:

print response['name']
print response[0]
print response[0]['name']

And all seem to give error. How do I access a list of just place names? Or just one place name?

¿Fue útil?

Solución

for b in response['businesses']:
    print b.get('name', 'missing')
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top