Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

read_html -- Error in read_connection_(x, n): Evaluation error: Failure when receiving data from the peer

Tags:

r

rvest

I'm using rvest and read_html to try and scrape a site. The scraping has worked for me before, but it won't work anymore. Using R version 3.4.2 and rvest 0.3.2

This is my code:

library(rvest)

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

and my error is:

Error in read_connection_(x, n) : 
  Evaluation error: Failure when receiving data from the peer.

Any ideas?

like image 874
Evan O. Avatar asked Jan 20 '26 15:01

Evan O.


1 Answers

Wrapping the URL in url() seems to do the trick.

read_html(url("http://hamilton.edu/news/story/the-medias-effect-on-womens-body-image"))
like image 179
Evan O. Avatar answered Jan 22 '26 08:01

Evan O.