Package "rvest" for web scraping https site with proxy

Stanislav  Shlykov picture Stanislav Shlykov · Mar 16, 2016 · Viewed 8k times · Source

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?

Answer

Matt picture Matt · Jul 19, 2016

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')