Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Package "rvest" for web scraping https site with proxy

I want to scrap a https website, but I failed.

Here is my code:

require(rvest)
url <- "https://www.sunnyplayer.com/de/"
content <- read_html(url)

But I have error in console- "Error in open.connection(x, "rb") : Timeout was reached" How I can fix this problem?

like image 313
Stanislav Shlykov Avatar asked Mar 16 '16 17:03

Stanislav Shlykov


1 Answers

The same thing happens to me on a proxy. To get around this, use download.file and specify a download location. You can then parse the file with read_html.

download.file(url, destfile = 'C://whatever.html')
content <- read_html('C://whatever.html')
like image 196
Matt Avatar answered Sep 21 '22 14:09

Matt