Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
read_html——read_连接中出错(x,n):评估错误:从对等方接收数据时失败_R_Rvest - Fatal编程技术网

read_html——read_连接中出错(x,n):评估错误:从对等方接收数据时失败

read_html——read_连接中出错(x,n):评估错误:从对等方接收数据时失败,r,rvest,R,Rvest,我正在使用rvest和read_html来尝试刮取一个站点。刮擦以前对我有用,但现在不行了。使用R版本3.4.2和rvest 0.3.2 这是我的代码: library(rvest) read_html("http://hamilton.edu/news/story/the-medias-effect-on-womens-body-image") 我的错误是: Error in read_connection_(x, n) : Evaluation error: Failure whe

我正在使用rvest和read_html来尝试刮取一个站点。刮擦以前对我有用,但现在不行了。使用R版本3.4.2和rvest 0.3.2

这是我的代码:

library(rvest)

read_html("http://hamilton.edu/news/story/the-medias-effect-on-womens-body-image")
我的错误是:

Error in read_connection_(x, n) : 
  Evaluation error: Failure when receiving data from the peer.
有什么想法吗?

将URL包装在URL()中似乎就可以了

read_html(url("http://hamilton.edu/news/story/the-medias-effect-on-womens-body-image"))

我无法重现您的错误,可能是版本特定的或网络相关的。是的,我不确定。我使用的是R版本3.4.2和rvest版本0.3.2。我会在描述中添加这些版本是最新的,我也在使用它们。这表明它与网络更相关,例如hrbrmstr建议的代理,您不会在代理服务器后面,是吗?一个
连接
对象起作用,但不是一个直接的URL(在封面下使用
httr
/
curl
),这一事实让我觉得代理与此有关。我怎么才能知道我是否在代理服务器后面?我不太熟悉这些东西如果使用Windows,那么你通常会在Internet Explorer的设置中看到它,除非你的网络使用透明代理,在这种情况下,它将更难以检测。