I send a request via google maps library and I get a result of 20 places.
My code looks like that
gmaps = googlemaps.Client(key='MY_KEY_IS_HERE')
x = gmaps.places(query=['restaurants', 'bakery', 'cafe', 'food'],location='40.758896, -73.985130',radius=10000)
print len(x['results']) # outputs 20 (which is maximum per 1 page result)
and afterwards I want to request a 2nd page and I use it I suppose correctly.
print gmaps.places(page_token=x['next_page_token'].encode())
and it returns a weird error
File "/Users/././testz.py", line 15, in <module>
print gmaps.places(page_token=x['next_page_token'].encode())
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/googlemaps/client.py", line 356, in wrapper
result = func(*args, **kwargs)
TypeError: places() takes at least 2 arguments (2 given)
I use .encode() because the 'next_page_token' outputs in unicode and googlemaps requires 'str'.
Any idea what am I doing wrong and how can I fix it ?