I am trying to read in the HTML code for a website into R but I keep encountering an error
> data=readLines("www.google.com")
Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") :
cannot open file 'www.google.com': No such file or directory
I tried to the following command prior to establish a connection.
> setInternet2(TRUE)
Error: 'setInternet2' is defunct.
See help("Defunct")
I also tried installing the library and updating R but with no luck.
library(installr)
updateR()
What do I need to get R to load the HTML code?