I am in need of Connectivity experts. I have been stuck for weeks, I can't figure out why does this RCurl Snippets likes to Timed Out in my case?
links <- c("https://www.investing.com/currencies/us-dollar-index-historical-data",
"https://www.investing.com/rates-bonds/u.s.-10-year-bond-yield-historical-data")
get_string <- c()
for(x in 1:length(links)){
con <- curl(links[ x ], "rb")
open(con)
html_string <- readLines(con, n = 3000)
idx_string <- which(html_string %like% "<span class=\"arial_26 inlineblock pid-")
price_head <- unlist(strsplit(unlist(strsplit(html_string[idx_string],">"))[2],"<"))[1]
#get_string <- c(get_string, html_string[idx_string])
get_string <- c(get_string, price_head)
close(con)
}
return(get_string)
I had to wrap this snippets in while() and try catch to see that it finally successfully connected after 5-10x Timeout Error
Error in open.connection(con, open = mode) :
Failed to connect to www.investing.com port 443: Timed out
In addition: There were 50 or more warnings (use warnings() to see the first 50)
Error in open.connection(con, open = mode) :
Failed to connect to www.investing.com port 443: Timed out
In addition: There were 11 warnings (use warnings() to see them)
Error in open.connection(con, open = mode) :
Failed to connect to www.investing.com port 443: Timed out
In addition: Warning messages:
1: In open.connection(con) : connection is already open
2: In open.connection(con) : connection is already open
Error in open.connection(con, open = mode) :
Failed to connect to www.investing.com port 443: Timed out
In addition: Warning messages:
1: In open.connection(con) : connection is already open
2: In open.connection(con) : connection is already open
3: In open.connection(con) : connection is already open
Error in open.connection(con, open = mode) :
Failed to connect to www.investing.com port 443: Timed out
In addition: There were 11 warnings (use warnings() to see them)
Error in open.connection(con, open = mode) :
Failed to connect to www.investing.com port 443: Timed out
In addition: Warning messages:
1: In open.connection(con) : connection is already open
2: In open.connection(con) : connection is already open
3: In open.connection(con) : connection is already open
4: In open.connection(con) : connection is already open
5: In open.connection(con) : connection is already open
6: In open.connection(con) : connection is already open
7: In open.connection(con) : connection is already open
Done Streaming Data for US CPI Model #--> This is Success Message
This is so far what I have try in my own:
- My Ping Status to the desired website host is actually fine:
-
Firewall Inbound and Outbound rules, I have set the allowance to port 443
-
When I changed my connection to mobile hotspot, this issue doesnt exist, it just successfully connected for 1 time only
-
I have flushed the DNS by Windows CMD:
Type
"ipconfig /flushdns"
and press Enter.
Type"ipconfig /registerdns"
and press Enter.
Type"ipconfig /release"
and press Enter.
Type"ipconfig /renew"
and press Enter.
Type"netsh winsock reset"
and press Enter. -
Last 2 week the connection was ok (1xattempt), but this issues started the next week it was ok.
-
I can browse the website directly through the browser without issues
-
I wanted to set this a longer timeout, but I didn't understand how