尝试rvest在R中使用包时收到以下错误:
open.connection(x,"rb")出错:无法连接到服务器
是什么导致此错误消息?功能如下所示:
htmlpage <- read_html("http://forecast.weather.gov/MapClick.php?lat=42.27925753000045&lon=-71.41616624299962#.V17UH-IrKHs")
Run Code Online (Sandbox Code Playgroud)
小智 6
我尝试了不同的方法,问题不在于代理连接,而在于R获取连接的方式.通过定义与url(your_url,"rb")的二进制连接,问题得以解决.
con <- url("http://www.imdb.com/title/tt1490017/", "rb")
lego_movie <- read_html(con)
Run Code Online (Sandbox Code Playgroud)