gpt4 book ai didi

r - 使用 R 时如何传递 curl --insecure 替代方案?

转载 作者:行者123 更新时间:2023-12-04 03:07:20 25 4
gpt4 key购买 nike

如何下​​载 this file使用 R 并将其保存到磁盘?

我已经通过在命令行上添加 --insecure 标志来使用 curl 下载它。但我不知道如何在 R 中做到这一点。

这是命令行方式:

curl https://www.stf.jus.br/arquivo/djEletronico/DJE_20171123_266.pdf --insecure --output ~/Desktop/test2.pdf

最佳答案

您可以使用 curl 库:

library(curl)

URL <- "https://www.stf.jus.br/arquivo/djEletronico/DJE_20171123_266.pdf"
h <- new_handle()
handle_setopt(h, ssl_verifyhost = 0, ssl_verifypeer=0)

curl_download(url=URL, "file_test2.pdf", handle = h)

关于r - 使用 R 时如何传递 curl --insecure 替代方案?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47715918/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com