我使用Google Places API收集有關企業的信息。它一直在爲超過2000個查詢工作,但它現在已停止,並出現錯誤使用Google Maps API的HTTP錯誤400
Error in open.connection(con, "rb") : HTTP error 400
。
代碼:
require(RJSONIO)
require(jsonlite)
require(utils)
place_url <- "https://maps.googleapis.com/maps/api/place/textsearch/json?query= "
key <- "Random_letters_generated_by_google"
setInternet2(TRUE)
query <- paste(business$name[1], city_name,country_name,sep = "+")
str_url <- as.character(paste(place_url ,query,"&key=",key,sep=""))
business_gis <- fromJSON(URLencode(str_url))
我見過another question用相同的錯誤,但涉及到HTML。我怎樣才能解決這個案件?它爲什麼停止工作?任何想法/提示是值得歡迎的。
我找到了解決方案,它是導致形成url的代碼中的一個錯字。士氣:你的連接錯誤可能與連接本身無關,更多的是通常的錯誤/錯誤。 – user3507584