open.connection错误(x," rb"):无法连接到服务器 [英] Error in open.connection(x, "rb") : Couldn't connect to server

查看:4450
本文介绍了open.connection错误(x," rb"):无法连接到服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在R中使用 rvest 包时收到以下错误:

I receive the following error when attempting to use the rvest package in R:


open.connection错误(x,rb):无法连接到服务器

Error in open.connection(x, "rb") : Couldn't connect to server

什么导致这个错误信息?该功能如下所示:

What is causing this error message? The function is shown below:

htmlpage <- read_html("http://forecast.weather.gov/MapClick.php?lat=42.27925753000045&lon=-71.41616624299962#.V17UH-IrKHs")


推荐答案

我尝试了不同的方法,问题不在代理连接中,而是以R获得连接的方式进行。通过使用url(your_url,rb)定义二进制连接,问题就解决了。

I tried different ways and the problem was not in the proxy connection, but in the way that R gets the connection. Through the definition of a binary connection with url(your_url, "rb") the problem was solve.

con <- url("http://www.imdb.com/title/tt1490017/", "rb") 
lego_movie <- read_html(con)

这篇关于open.connection错误(x,&quot; rb&quot;):无法连接到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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