【问题标题】:Errors when trying to download ZIP file from URL尝试从 URL 下载 ZIP 文件时出错
【发布时间】:2020-10-19 11:45:57
【问题描述】:

我正在尝试在 R 中下载 ZIP 文件并提取 CSV。 我在 StackOverFlow 上找到了几个解决方案,例如 Using R to Download and extract zip file that contains a folder,

但我收到错误消息。 我的代码:

url <- 'https://www.intervista.ch/media/2020/03/Download_Mobilit%C3%A4ts-Monitoring_Covid-19.zip'

temp <- tempfile()
download.file(url,temp)

错误输出(从德语翻译):

download.file(url, temp) 中的错误: 无法打开 URL 'https://www.intervista.ch/media/2020/03/Download_Mobilit%C3%A4ts-Monitoring_Covid-19.zip' 附加警告: 在 download.file(url, temp) 中: URL 'https://www.intervista.ch/media/2020/03/Download_Mobilit%C3%A4ts-Monitoring_Covid-19.zip':状态为'SSL peer certificate or SSH remote key was not OK'

【问题讨论】:

    标签: r zip downloadfile


    【解决方案1】:

    您似乎遇到了 SSL 问题,通常是 curl isse - Get site content over SSL with httr in R:可能会尝试遵循这些建议的解决方案,因为以下代码对我有用:

    Modalsplit <- read.csv(unz(temp, "Modalsplit_pro_Tag.csv"))
    Mittelwerte <- read.csv(unz(temp, "Mittelwerte_und_Median_pro_Tag.csv"))
    Distanz <-read.csv(unz(temp, "Mittelwerte_und_Median_pro_Tag.csv"))
    

    【讨论】:

      猜你喜欢
      • 2017-10-17
      • 2020-07-21
      • 1970-01-01
      • 1970-01-01
      • 2017-12-27
      • 1970-01-01
      • 2022-08-03
      • 1970-01-01
      • 2021-03-22
      相关资源
      最近更新 更多