【发布时间】:2016-07-05 22:10:09
【问题描述】:
我正在使用带有 R 的谷歌自定义搜索。代码看起来像,
library(httr,lib.loc = "C:\\R packages")
URL<-"https://www.googleapis.com/customsearch/v1?"
key<-"key=xxxxxxxxxxxxxxxxxxxxxxxexxx"
cx<-"&cx=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
q<-"&q="
prod<-gsub(" ","+",prod)
URL<-paste0(URL,key,cx,q,prod)
当我将 URL 复制粘贴到浏览器中时,我能够获得 json 输出。不过,
content(GET(URL))
给出以下错误,
Error in curl::curl_fetch_memory(url, handle = handle) :
Problem with the SSL CA cert (path? access rights?)
任何输入都会很棒。谢谢。
【问题讨论】:
-
如果URL返回JSON,也许试试
library(jsonlite); fromJSON(url) -
成功了!谢谢大佬
标签: json r google-custom-search