Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

html

r

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

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")
like image 790
N. Shep Avatar asked Dec 24 '22 04:12

N. Shep


1 Answers

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 of the url within url() the problem was solved.

con <- url("http://www.imdb.com/title/tt1490017/", "rb") 
lego_movie <- read_html(con)
like image 111
Tom Meallant Avatar answered Feb 04 '23 04:02

Tom Meallant