google_places()中的下一页令牌Googleway包

时间:2018-05-09 19:37:43

标签: r json google-api google-places-api googleway

我正在使用Googleway软件包,特别是google_places()函数来提取商店数据。我知道每个google_places()调用产生20个数据,我可以使用下一页令牌访问总共60个数据。我的问题是,我能够访问第二个20个数据点,但不能访问最后20个数据点,因为它会提示错误消息。

key <- 'insert own api key'
loc <- c(33.685494, -117.812070)
df <- google_places(place_type = "store",location = loc, radius = 1500, key = key)
df_next <- google_places(place_type = "store",location = loc, radius = 1500, key = key, page_token = df$next_page_token)
直到这一刻,一切正常,我才能得到40家商店。

df_next_two <- google_places(location = loc, radius = 1500, key = key, page_token = df_next$next_page_token)

这会产生错误:

Error: lexical error: invalid char in json text.
                                   https://maps.googleapis.com/map
                 (right here) ------^

有没有办法解决这个问题?感谢。

0 个答案:

没有答案
相关问题