rvest read_html函数不起作用 [英] rvest read_html function does not work

查看:410
本文介绍了rvest read_html函数不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用read_html时,收到以下错误:

When trying to use read_html, I receive the following error:

Error in open.connection(x, "rb") : error setting certificate verify locations: CAfile: microsoft-r-cacert.pem CApath: none

此功能适用于在OSX El Capitan上运行标准R 3.4.3的MacBook。我现在正试图在Ubuntu 16.04上运行MRO 3.4.3的服务器上使用它。

This function works on my MacBook running standard R 3.4.3 on OSX El Capitan. I'm now trying to use it on a server running MRO 3.4.3 on Ubuntu 16.04.

推荐答案

我会检查一些事情,此外你可能需要在Linux上设置一个环境变量来使事情发挥作用:

I would check a few things, in addition you may need to set an environment variable on Linux to get things to work:

1)  确保文件'microsoft-r-cacert.pem'存在于以下目录中并且大小大于0字节:

1).  Make sure that the file 'microsoft-r-cacert.pem' exists in the following directory and has a size greater than 0 bytes:

/opt/microsoft/ropen/3.4.3/ lib64 / R / lib

/opt/microsoft/ropen/3.4.3/lib64/R/lib

2)。在运行代码之前,请尝试在R控制台中设置以下环境变量:

2). Try setting the following environment variable in the R console, before running your code:

Sys.setenv(CURL_CA_BUNDLE =" /opt/Microsoft/ropen/3.4.3/lib64/R/ lib / microsoft-r-cacert.pem")

Sys.setenv(CURL_CA_BUNDLE = "/opt/Microsoft/ropen/3.4.3/lib64/R/lib/microsoft-r-cacert.pem")

希望这会有所帮助。

Stephen Weller

Stephen Weller

Microsoft R产品团队

Microsoft R Product Team


这篇关于rvest read_html函数不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆