Error in curl::curl_fetch_memory(url, handle = handle) : Failed to connect to www.etsy.com port 4
今天用R爬取外网数据一直报错,就是没办法获取网页,返回错误:Error in curl::curl_fetch_memory(url, handle = handle) :Failed to connect to www.etsy.com port 443: Timed out看到这个链接里也有人出现相同的问题:Getting connection timed out error while Ge
·
今天用R爬取外网数据一直报错,就是没办法获取网页,返回错误:
Error in curl::curl_fetch_memory(url, handle = handle) :
Failed to connect to www.etsy.com port 443: Timed out
看到这个链接里也有人出现相同的问题:Getting connection timed out error while GeoCoding in R - Stack Overflow
里面有个答案,也就是在请求网页前加上以下代码,就可以成功获取网页内容了。(我自己是挂了vpn去爬数据的)
library(httr)
set_config(
use_proxy(url="Proxy_Add_Here", port=8090)
)
不知道代理地址是什么的话,就打开设置>网络和Internet>代理,就可以看到地址和端口,对应填上就可以。再输入httr::GET("www.google.com"),把谷歌改成自己要的网址,返回200就是请求成功。
改天再把完整的R爬取外网流程记录一下。
httr::GET("www.google.com")更多推荐



所有评论(0)