I am trying to connect to google using R but I'm having some issues with the proxy/auth settings. Using VBA all I have to run is the below which works fine:
Function GetResult(url As String) As String
Dim XMLHTTP As Object, ret As String
Set XMLHTTP = CreateObject("MSXML2.ServerXMLHTTP.4.0")
XMLHTTP.Open "GET", url, False
XMLHTTP.send
ret = XMLHTTP.responseText
GetResult = ret
End Function
Sub Example()
'Print the HTML of Google.com
Debug.Print GetResult("http://www.google.com")
End Sub
In R, if I run the following:
library('rvest')
url <- 'http://google.com'
webpage <- read_html(url,verbose=TRUE)
I get
Error in open.connection(x, "rb") :
Timeout was reached: Connection timed out after 10000 milliseconds
There is an issue with the proxy settings that is being used in R. Is there a way I can figure out what proxy settings VBA is using in excel and use those in R?