Reputation: 522
I crawl web data in R.
library(rvest)
library(stringr)
getwd()
body = c()
url = c()
url_base = "web address"
for(i in 1:4)
+ {
+
+ url_crawl = paste(url_base, i , sep="")
+ b_css = "css code"
+
+ hdoc = read_html(url_crawl)
+
+ b_node = html_nodes(hdoc, b_css)
+
+ }
Error in
open.connection(x, "rb")
: Could not resolve proxy:myproxy.server.com
I used this code but now i can't use it. how to solve this problem?
Upvotes: 1
Views: 1396
Reputation: 522
I solved it. This happens because my computer or program has a proxy server. So initialize. This code will be fine.
Sys.setenv("http_proxy"="")
Sys.setenv("no_proxy"=TRUE)
Sys.setenv("no_proxy"=1)
Upvotes: 1