[英]Download file from page that makes you wait using RCurl
I want to download a file from a page that makes me wait for the download. 我想从页面下载文件,这让我等待下载。 Following this answer an example of curl code would be:
在此答案之后,卷曲代码的示例将是:
curl -O -J -L http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.8.1/bitcoin-0.8.1-linux.tar.gz/download
which does what I want from the terminal. 这是我在终端上想要的。 Now I want to do this using
RCurl
in R, but I have no idea where to start... 现在我想在R中使用
RCurl
来执行此操作,但是我不知道从哪里开始...
The following worked for me (using httr
which is a modern wrapper for RCurl
): 以下为我工作(使用
httr
这是现代包装RCurl
):
library(httr)
url <- "http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.8.3/bitcoin-0.8.3-linux.tar.gz/download"
dl <- GET(url, write_disk("bitcoin-0.8.3-linux.tar.gz"), verbose())
The verbose()
is purely for interactive debugging and can be removed. verbose()
仅用于交互式调试,可以将其删除。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.