在利用R进行爬虫,时安装“rvest”包,时出现了错误,出现的错误提示如下:
Warning in install.packages :
package ‘rvest’ is not available (for R version 3.5.3)
Error in install.packages : error reading from connection
因此,具体操作如下几步
1.首先,需要将Rstudio默认的下载镜像切换成国内的下载镜像;
2.有多个国内下载镜像,还不行就多试几次,我选择的是北京大学的下载镜像;
3.输入:install.packages("rvest"),等待安装成功;
> install.packages("rvest")
also installing the dependencies ‘sys’, ‘askpass’, ‘jsonlite’, ‘mime’, ‘openssl’, ‘xml2’, ‘httr’, ‘selectr’
There is a binary version available but the source version is later:
binary source needs_compilation
jsonlite 1.6 1.6.1 TRUE
Binaries will be installed
trying URL 'https://mirrors.tuna.tsinghua.ed