I tried to scrape HTML table as data.frame
in R, and I used existing solution scraping html in R, but R raised an error down below:
> theurl <- "https://www.dwd.de/DE/leistungen/klimadatendeutschland/statliste/statlex_html.html?view=nasPublication&nn=16102"
> webpage <- getURL(theurl)
Error in function (type, msg, asError = TRUE) :
error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
I don't understand why this error happened. How can I resolve this problem? Basically, I want to scrape HTML table as data.frame in R, but now R complains about unknown protocol error. Any idea?
How can I scrape German weather station data as a data.frame
in R? How to fix the error? Thanks
Here is session information so you can check on your machine.
> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets
[6] methods base
other attached packages:
[1] rlist_0.4.6.1 RCurl_1.95-4.8 bitops_1.0-6
[4] XML_3.98-1.5
loaded via a namespace (and not attached):
[1] compiler_3.4.3 tools_3.4.3 yaml_2.1.14
[4] data.table_1.10.4
Update: my tryout based on SO
given solution
theurl <- httr::GET("https://www.dwd.de/DE/leistungen/klimadatendeutschland/statliste/statlex_html.html?view=nasPublication&nn=16102",.opts = list(ssl.verifypeer = FALSE) )
tables <- readHTMLTable(theurl)
Here is the error:
> tables <- readHTMLTable(theurl)
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘readHTMLTable’ for signature ‘"response"’